Just practicing my HTML / css and learning react along the way…
Any thoughts, comments, concerns?
Just practicing my HTML / css and learning react along the way…
Any thoughts, comments, concerns?
You are using react but also manipulating DOM elements directly when you can do it using React.
I also see you creating the app in a single component - the point of components is to create reusable components so you write less code and follow the DRY principle . I looked at your if statements and there’s a lot of repeated lines of code.
My advice is that in your next project, take a step back and look at the project from a high level and try to understand what could be a component and how you could pass props down to change the data it uses.
I think it’s a good idea to start looking into functional components this way you can learn about hooks and really understand what the point of React is and how things work.
Lastly, I recommend doing projects using Create React App template and creating static sites with your preferred site (github/gitlab/vercel etc)
Awesome, thanks for the advice!
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.