Drizzle tutorial with React Hooks¶
I created a complete React Hooks version of this Drizzle tutorial.
You will need to install Node.js and Truffle, as stated in the tutorial - see "Setting up the development environment".
See the ReactJS guidance on using hooks and Drizzle for further details on implementing hooks in your project.
To get this box¶
-
Create a new directory.
-
In the new directory, run
truffle unbox atkinsonholly/Drizzle-tutorial-with-React-Hooks
. This should pull the box contents to the new local directory.
After unboxing¶
In the client directory:
npm install
In the main project directory:
truffle develop
Then, in the Truffle developer console:
compile
and then:
migrate
To test your smart contract(s), in truffle's developer console:
test
Now that you have successfully launched your Solidity contract onto your local blockchain, go into the client directory:
cd client
Run the project by entering the following:
npm start
To see your project in the browser, go to http://localhost:3000/
You can test your DApp by entering the following:
npm test
Troubleshooting¶
You may need to install Xcode to use this box on macOS, see node-gyp on Github. The following command may be useful if you encounter issues with this: xcode-select --install
.