@thaismr
Full Stack Developer
Nothing here yet.
Nothing here yet.
No blogs yet.
"Companies on the cutting edge of React development like Facebook, Netflix, and Airbnb all readily use functional components. It seems pretty clear the upsides outweigh the negatives." When should you NOT use functional components? When you have no other option. https://programmingwithmosh.com/react/react-functional-components/ I have read from REACTs official docs that functional components, when possible, are preferable as standard, can't find the exact page now, but you can see the site above explaining it very well.
I would take my code away from codepen and save it at my desktop.. Whatever you are currently working at, save it on your computer's desktop, right at hand. Own it! Plus, saving it at codepen makes it look okay if it is just partial code.. when you save it as a full web page, you can watch your progress better, and think at the whole picture. Even if you start with just < p > This is my first page </ p > Then, just work from there. Write some content, add Boostrap, style it, create a second page, link them together.. You can use Windows Notepad to edit your page, just save it with .html extension. Download VScode or Atom to edit your code, place your HTML pages under the same directory at your computer's desktop, open the directory at one of these editors, and continue your progress. I had the same difficulty understanding Javascript for a very long time, due to it being event-based. I wasn't sure what was being executed and when. Learned other languages before I went back to it, suddenly it became understandable after I followed a REACT course on Udemy. After you rebuild and save your site on your local computer, as HTML+CSS, I suggest two things: 1) Publish it online, any free static site host will do. It could be motivating. 2) Give Gatsby a try. Clone a Gatsby starter site, follow their tutorials. You can later move to learning REACT (mixing REACT dynamic pages inside your gatsby site) and later yet go back to raw Javascript tutorials. Most people would tell you to first understand plain JavaScript, but somehow I only started understanding JavaScript while learning REACT. Now, if I search any JS solution, or use it raw at a website, I understand it easily, can't really explain why, feels like it should have always been so easy.
Harcourt Hamsa Try losing the "{ return( ); }" function at line 65, leave just the <UserList /> with it's contents. Try this: {users.length === 0 ? 'loading' : users.map (user => < UserList id = {user._id} key = {user._id} firstname = {user.firstname} lastname = {user.lastname} deleteUser = {handleDeleteUser} /> ) } Extracting the users.map() function to a variable might help debugging. See samples here: https://reactjs.org/docs/lists-and-keys.html