Chapter 07: Finding the Path

  1. don’t create a component inside the component, keep it on the top level you can compose it if it is required because it will create the same component again and again on each render
  2. never create a state variable using useState inside if-else or inside for loop
  3. react give useState hooks to create local state inside functional component never use useState outside functional component

React-router

  1. create component with rafce
  2. SPA(Single Page Application) =>
  3. 2 type of routing
    1. client side routing
    2. server side routing
  4. all the children will go in outlet
  5. Dynamic routing or Dynamic segment
    useParams react Hooks provided by react-router-dom, using which we can read dynamic url
    react-dom and react-router-dom are different
  6. create separate logical block component
    it will help your code modular, maintainable, readable, reusable, testable

Leave a Comment