๐ hi there! My name is Kent C. Dodds and this is the source material for Build a React App!
NOTE: This repository is used for a multi-part workshop
In order for us to maximize our efforts during the workshop, please complete the following things to prepare.
๐บ only necessary if the workshop is remote via Zoom
๐ specific to the material for this workshop
3๏ธโฃ Only needed to prepare for part 3 of this workshop
4๏ธโฃ Only needed to prepare for part 4 of this workshop
๐ Setup the project (follow the setup instructions below) (~5 minutes)
๐บ Install and setup [Zoom](https://zoom.us) on the computer you will be using (~5 minutes)
๐บ Watch [Use Zoom for KCD Workshops](https://egghead.io/lessons/egghead-use-zoom-for-kcd-workshops) (~8 minutes).
Watch How to get the bookshelf app setup (~18 minutes). Please do NOT skip this step.
๐ Watch The Beginnerโs Guide to React (available free on Egghead.io), or have the equivalent experience (147 minutes)
๐ Watch my talk [Why React Hooks](https://www.youtube.com/watch?v=zWsZcBiwgVE&list=PLV5CVI1eNcJgNqzNwcs4UKrlJdhfDjshf) (35 minutes)
๐ Go through my Learn React Hooks Workshop, or have the equivalent basic experience of using hooks. You should be experienced with useState
, useEffect
, and useRef
.
๐ 3๏ธโฃ Go through my Advanced React Hooks Workshop, or have the equivalent basic experience of using advanced hooks. You should be experienced with useContext
, useReducer
, useMemo
, and useCallback
.
๐ 4๏ธโฃ Go through my [Testing React Apps Workshop](https://kentcdodds.com/workshops/testing-react-apps), [TestingJavaScript.com](https://testingjavascript.com), or have the equivalent experience testing React components with [Jest](https://jestjs.io/) and [React Testing Library](https://testing-library.com/react).
The more prepared you are for the workshop, the better it will go for you.
All of these must be available in your PATH
. To verify things are set up properly, you can run this:
git --version
node --version
npm --version
If you have trouble with any of these, learn more about the PATH environment variable and how to fix it here for windows or mac/linux.
After youโve made sure to have the correct things (and versions) installed, you should be able to just run a few commands to get set up:
git clone https://github.com/kentcdodds/bookshelf.git
cd bookshelf
npm run setup --silent
If you get any errors, please read through them and see if you can find out what the problem is. If you canโt work it out on your own then please file an issue and provide all the output from the commands you ran (even if itโs a lot).
To get the app up and running (and really see if it worked), run:
npm start
This should start up your browser. If youโre familiar, this is a standard react-scripts application.
You can also open the production deployment: bookshelf.lol.
npm test
This will start Jest in watch mode. Read the output and play around with it. The tests are there to help you reach the final version, however sometimes you can accomplish the task and the tests still fail if you implement things differently than I do in my solution, so donโt look to them as a complete authority.
To get started, run:
node go
This will allow you to choose which exercise you want to work on. From there, open the INSTRUCTIONS.md
file and follow the instructions there.
If youโd like to work on an extra credit, but you want to skip the preceding steps, you can run node go
again:
node go
This will let you choose the next exercise or you can choose which part of the exercise youโd like to work on. This will update your exercise
files to the correct version for you to work on that extra credit.
Snuggle up next to the ๐ฅ with a good ๐
๐ Iโm Kent C. Dodds
This workshop is a bit different from my other workshops. The exercises are much longer and youโll have more time to complete them. Weโll also be taking breaks mid-exercise, wherever thereโs a need. So consider this schedule to be very loose.
Please do ask! Interrupt me. If you have an unrelated question, please ask on my AMA.
The exercises are in different branches. Each branch changes the INSTRUCTIONS.md
file to contain instructions you need to complete the exercise.
The purpose of the exercise is not for you to work through all the material. Itโs intended to get your brain thinking about the right questions to ask me as I walk through the material.
Each exercise has comments in it to help you get through the exercise. These fun emoji characters are here to help you.
INSTRUCTIONS.md
User
List Item
Date.now()
)Date.now()
)For convenience, our friendly backend engineers also return a book
object on each list item which is the book itโs associated to. Thanks backend folks!
me wishes we could use GraphQL
If your โdatabaseโ gets out of whack, you can purge it via:
window.__bookshelf.purgeUsers()
window.__bookshelf.purgeListItems()
Book
Each exercise has an Elaboration and Feedback link. Please fill that out after the exercise and instruction.
At the end of the workshop, please go to this URL to give overall feedback. Thank you!
Author: kentcdodds
Demo: https://kentcdodds.com/workshops/build-react-apps-1/
Source Code: https://github.com/kentcdodds/bookshelf
#reactjs #react #javascript