React tutorial adapted from Wes Bos Javascript30 - Day 02 - JS + CSS Clock tutorial. I originally created this using vanilla js as seen here.
- Install node.js
- Have a code editor handy (I like Atom)
- Install React dev tools
- Run
npx create-react-app react-clock
- Note: this command installs a temporary create-react-app and calls it, without polluting global installs or requiring more than one step! Learn more
cd react-clock
- Copy the starter-files into
react-clock/src
npm start
- Set state (constructor)
- Get initial time (props)
- Set timer (componentDidMount/componentWillUnmount)
- Check dev tools
- define tick
- Add inline style