Posts by Gabriel Brito • 174 points
5 posts
-
1
votes2
answers467
viewsA: Share a Hook from one component to another
Give a check on the response of this post What is "Prop Drilling"? for a more complete explanation, there are also some examples of the three alternatives cited below. There are three alternatives:…
-
1
votes1
answer417
viewsA: Infinite loop with useEffect and useCallback
About the useCallback itself documentation says that: This is useful when we use callbacks to optimize components children but the callback is not being passed to a child component. So the correct…
-
0
votes2
answers215
viewsA: Did "Class Components" die in React?
In the documentation itself they say they do not intend to remove React classes. We have no plans to remove classes from React. You can learn more about the gradual adoption strategy for Hooks at…
-
2
votes1
answer501
viewsA: Problem with infinite loop component in React
The method useMemo receives two parameters, the first one (you sent) is a function in which the return will be the value that useMemo will store and return to its variable. The second parameter is…
-
0
votes1
answer217
viewsA: Are there any devaluations of creating a component in React per function instead of Class?
Prior to the introduction of Hooks, the biggest difference between a component extending React.Component (class) and a stateless Component (function) was the possibility of maintaining an internal…