Truffle and React
Let's build a small Dapp using Truffle and React.
Note
This is not meant to be a tutorial on the inner workings of React. If you are not familiar with React, I suggest you read up on it first—here is a good place to start: https://reactjs.org/tutorial/tutorial.html.Once you have a basic understanding of React, you are ready to begin this section.
Let's get started.
The Truffle and React starter
As usual, let's start with a starter. You can get the Truffle and React starter right here: https://github.com/truffle-box/react-box.
If you skipped the Angular chapter, you need to do the following first. Inside your truffle-practice
folder, create a new folder called chapter5
.
Now that you have a folder for this chapter, create a new folder called truffle-react
inside the chapter5
folder.
To set up this project, go inside truffle-practice/chapter5/truffle-react
and run the following commands in your terminal:
truffle unbox react
.truffle develop
.
- Inside the Truffle development console, run...