Skip to content

shop3/react-ipfs

Repository files navigation

React IPFS Provider

IPFS provider for a react application.

Installation

npm install --save @shop3/react-ipfs

Usage

import React, { useEffect } from 'react';
import { IPFSProvider, useIPFS } from '@shop3/react-ipfs';

const App = () => {
  return (
    <IPFSProvider>
      {/* app here */}
    </IPFSProvider>
  )
}

const Example = () => {
  const ipfs = useIPFS();

  useEffect(() => {
    if (ipfs) {
      // use ipfs here
    }
  }, [ipfs]);
}

Development

Installation

npm install

npm run husky:install

Development

npm run develop