React Flashcards
1
Q
how can use props to optimize React re-renders
2
Q
what pure component in react?
A
- when using class componenst we had pure component, it was check the props to check if needs to rerender or not
- now in hooks (functional component) it’s pure by default (expect key)
3
Q
what is error boundery component in react ?
A
it helps you limit the impact of an error, it allows you to not broke the app by breaking one component, and gives you a place holder to show a message by wrapping it
allows to localize the errors and manage them
4
Q
useEffect hooks ?
why it doesn’t accept async
A
- trigger a side effect
- when a deps changes
- it runs after component rerender and maybe rerender again
why async ?
the return function of effect (clean up) accepts only synchronous function
allowing it causes unintentional side effects or race conditions.
5
Q
A