"React: Write a React Component from Scratch" - Should I be doing this from memory?

I’m going through the React lessons for the second time, and I have a question about this exercise. Are we supposed to be able to build a react Component from Memory? How important is that we memorize the exact syntax including, capitalization, and every parenthesis and curly bracket, or is the idea that we shoudl be able to google the syntax, or use NPX Create-React-App in order to get the basic structure of our componenets?

Nobody can remember everything. A big part of being a developer is knowing what is available/possible and being able to find the answers.

Specifically, no, I wouldn’t have been able to write a React App from scratch at your point. As far as a component, yeah, I’m sure it took a couple tries before I could right a React component from scratch by memory, and took a while before I could wire it up to Redux from memory. I still sometimes have to look up some of the more obscure React lifecycle methods, and I’m a professional React developer.

Don’t worry about memorizing everything. Worry about increasing your understanding and comfort. The point isn’t to be able to be able to parrot back syntax but to be able to understand it and use it. I’d much rather work with a developer like that than someone who had it all memorized but didn’t understand it.

Try it without looking it up. If it doesn’t work, then look it up and try to cement it in your memory a little. Eventually the important things (the things you use a lot) will stick. And the things you don’t use very often, you’ll need to look up. This is normal.