Notes
Notes
U can open current folder in VSCode directly from cmd by entering command "code ."
To open current folder from file Explorer in cmd : Alt+D and then type cmd
We can also use React.memo to stop re-rendering of those componests whose props are
unchanged
Side effect is something that encompasses any operatioins that reach outside the
functional scope of React component. These operations can affect outer components,
interact with the browser or perform asynchronous fetching. eg: setTimeout, fetch,
setInterval. These should be seprate from rendering cycle.
Hooks: They allow functional components to have access to stateful logic and
lifecycle features.
First function inside useEffect should not by async. If u really want to make is
async either define function outside or use useAsyncEffect library.
Using Context API doesn't make application more performant. Its just a syntactic
sugar. Still the middle components that lie between parent and the untimate child
that needs state variable are rerendered. It just make syntax cleaner. This only
solves problem of prop drilling.
To solve the above shortcoming of context api we use state management libraries.
Using recoil we can make only those components re-render whose state changes.