Skip to main content

Quick start

(in 5 minutes or less 😉)

  1. Create a React app
  2. Connect your app to your smart contracts.
  3. Install Eth-hooks in your React app root folder by entering the following in your terminal
yarn add eth-hooks
  1. Setup context in your React app index.tsx file
src/index.tsx

<ContractsAppContext>
<EthersAppContext>
<App />
</EthersAppContext>
</ContractsAppContext>

  1. If you're using providers, here's an example of how they sould look in your App.tsx file
src/App.tsx
export default function App() {
return (
<ContractsAppContext>
<EthersAppContext>
<ThemeSwitcherProvider>
<MainPage />
</ThemeSwitcherProvider>
</EthersAppContext>
</ContractsAppContext>
);
}

Now you can use any Eth-hook you need anywhere in your application.

Need an out-of-the-box fullstack application?

Try Scaffold-eth (Solidity, Hardhat, Ethers, and React.

Did someone say Typescript?