python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
Passing a value up in react without writing state in parent
What I am trying to do:
I need price * quantity = total. I have a table with price as one , quantity as one and total as one . Quantity is a counter and needs to have its own state as rows will be ad...
mike
Votes: 0
Answers: 1
Why use useMemo and not useCallback here?
So as i understand the difference between the two is that useCallback is used if a function or object or array is returned while useMemo when a primitive is returned.
But i was looking up debouncing (...
H.b
Votes: 0
Answers: 3
Render only components with changes
I have an array with thousands of strings and is passed to a component:
Main component:
const array = ['name1', 'name2', 'name3'];
const [names, setNames] = useState(array);
const onClick = (index) =...
Henny Lee
Votes: 0
Answers: 2
Memorizing values upon an async call in react
I'm trying to memorize some values in a react component because it's re rendering even when data hasn't changed (and wont change). Using useEffect + useState the data displays correctly, but the funct...
yieniggu
Votes: 0
Answers: 0