How can i achieve something like this for a functional component in Kotlin react. Below is a code snippet from a class component written in Javascript.
If you notice the code below updates the state and after something like a callback runs after. Basically what i want to achieve is to "Do something after state is updated" in a functional component.
Copy code
this.setState(state => ({
...state,
stack: [...state.stack, state.sceneConfig[sceneName]],
}), () => {
// Do something here
});
t
turansky
09/23/2021, 7:08 AM
Copy code
var stack by useState(42)
useEffect(stack) {
// Do something here
}