Questions tagged [react-hooks]
The react-hooks tag has no summary.
4 questions
-1
votes
1
answer
628
views
ReactJS hook vs utility function
Should we use utility functions in react or should everything be components and hooks?
I had this scenario:
Utility function for formatting money.
const formatMoney = (value) => value == null ? '' :...
1
vote
2
answers
3k
views
Preventing parent component re-rendering of a big React component when you "Lift State Up"
I have a very big form - let's call it <MyForm> - consisting of the following:
text fields and dropdowns
custom selector made of selectable cards
table input (for this example 50 rows with each ...
2
votes
0
answers
264
views
React Hooks: using state in useEffect without depending on it
I have run into a situation in React where I want to run a function F in a useEffect hook whenever a value V1 from the store changes. F uses another value from the store V2. I only want to run F when ...
-2
votes
1
answer
85
views
React class or function for stateful components?
Which is better to use? react class based stateful component or react hooks functional stateful component? I've searched a bit but couldn't find what is preferred to use.