updateTrigger does not work with react state #5989
-
Hello everyone, I am using
As my source code is using all layers as states and now i start using Appreciate your help 😄 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 8 replies
-
Not sure what you are trying to accomplish by using state here. But when you call https://reactjs.org/docs/hooks-state.html#declaring-a-state-variable |
Beta Was this translation helpful? Give feedback.
Not sure what you are trying to accomplish by using state here. But when you call
useState(layer)
,layer
is the initial state, i.e. the value is only read the first time it's called. After that you need to callsetLayerState
to changelayerState
.https://reactjs.org/docs/hooks-state.html#declaring-a-state-variable