1.0.6 • Published 4 years ago

react-ipfs-provider v1.0.6

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

react-ipfs-provider

npm package

IPFS Context Provider for React, all the fun of IPFS with as little prop drilling and double locking repo's as possible

Install

With NPM

npm i --save react-ipfs-provider

With Yarn

yarn add react-ipfs-provider

Usage

App.js

import React from 'react';
import Component from './component';
import { Provider } from 'react-ipfs-provider';

export default function App(props){
  return (
    <Provider ipfs={/* optional ipfs node prop */}>
      <div>
        <Component />
      </div>
    </Provider>
  );
}

Component.js

import React from 'react';

import { withIPFS } from 'react-ipfs-provider';

function Component(props){
  
  React.useEffect(() => {
    props.ipfs.add('Content to IPFS')
  }, [])
  
  return (
    <div>
      {props.ipfs.provider.id} 
    </div>
  );
}

export default withIPFS(Component)
1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago