Skip to content
- 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
- never create a state variable using useState inside if-else or inside for loop
- react give useState hooks to create local state inside functional component never use useState outside functional component
React-router
- create component with rafce
- SPA(Single Page Application) =>
- 2 type of routing
1. client side routing
2. server side routing
- all the children will go in outlet
- 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
- create separate logical block component
it will help your code modular, maintainable, readable, reusable, testable