Skip to content

Instantly share code, notes, and snippets.

@GeoffMahugu
Created December 13, 2021 15:53
Show Gist options
  • Save GeoffMahugu/91b73140ed995a7fc1efc950a2b32cac to your computer and use it in GitHub Desktop.
Save GeoffMahugu/91b73140ed995a7fc1efc950a2b32cac to your computer and use it in GitHub Desktop.
This is the index.js file for react web3 app.
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import { Web3ReactProvider } from '@web3-react/core'
import Web3 from 'web3'
function getLibrary(provider) {
return new Web3(provider)
}
ReactDOM.render(
<React.StrictMode>
<Web3ReactProvider getLibrary={getLibrary}>
<App />
</Web3ReactProvider>
</React.StrictMode>,
document.getElementById('root')
);
reportWebVitals();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment