Catch Of The Day
React Practice with Wes Bos
This one is courtesy Wes Bos' React For Beginners course. I completed it in 3 days. I couldn't study in between for a couple of days, so if I'm being a purist, I took 5. But the course was a cool one and I picked up a few things. The most important thing that I picked up was that these courses will not help me. The solution forward is simply to look at the end result and clone it. After which I can go through the course to refactor my code.
For this one, I added in the following concepts:
- State
- setState
- In React, we do not like to touch the DOM directly. Instead, we use refs. With `React.createRef()` we can open up that
- Learnt how to uppercase in VS Code - just do CTRL + SHIFT + P and then search for 'upper'.
- The functions that are manipulating the state should be in the same component as the state.
- If we need access to the key in our components, we need to pass it a second time as a prop. key = { key } will not be useful here. You'll have to pass index = { key }.
- Use {...this.state} to pass the whole state down as a prop.
- Updating state through an input isn't straightforward. There is some magic going on there that I'll have to explore further.
- Picked up Proptypes
- For this blog post, I had to work around displaying the curly braces as part of the write-up and `JSX` wouldn't let me do this. I got to understand that this is one of JSX gotchas. In order for me to achieve this, I'd have to type in the HTML character codes directly in the text. This stackoverflow answer helped.
I didn't complete authentication. It seemed convoluted and felt like right now I just need to move to the next app.
Deployment