Why is this no longer acceptable in SDK 39?
const [MyId, setMyId] = useState(“”);
function gettheid (responseJson) {
setMyId(responseJson);
}
It generates the following error:
Warning: Cannot update a component from inside the function body of a different component.
Does it mean that I can no longer update a useState within a function? I’m confused.