Answer the question
In order to leave comments, you need to log in
useEffect hook, how to use props but not update them?
I'm using the useEffect hook to trigger some actions when the component mounts.
Here is the code:
useEffect(() => {
onChange(
bar1 ? graphData.displayedItems[bar1.value] : null,
bar2 ? graphData.displayedItems[bar2.value] : null,
by ? byOptions[by.value] : null
)
}, [])
Answer the question
In order to leave comments, you need to log in
If React added this warning, there should be a solution for this.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question