Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Dynamically do something after a useState variable has been set?
+2
−0
Since setState is asynchronously executed, how to dynamically do something after a useState variable has been set?
Consider
import { useState } from "react";
const [myVar, setMyVar] = useState("");
After
setMyVar("New String");
How to listen for that?
1 answer
+0
−0
0 comment threads