The useEffect hook runs when one of the variables in the hook’s second argument, which is the dependency array, changes its value. However, I think you need to use the useAction because it will run when the function runs for the purpose of synchronising the state of the function with external systems such as the Forge storage service.
According to the Forge docs this should work. I’m guessing it’s some kind of bug in their custom React environment. Some ideas to try:
Try setting formData in the useState hook instead of useEffect. This should work according to docs because it can take an async function. const [formData, setFormData] = useState(await storage.get(STORAGE_KEY_PREFIX + 'App_Control')); This seems like the equivalent of what you are trying to accomplish with the useEffect hook. That is, setting the intitial formData state from storage.
Try removing the empty dependency array in useEffect. In this case, I don’t think it’s a necessary optimization since this is rendered on the server. It’s not like client-side react, where each keystroke can trigger a possible re-render.
How do you know the item is in storage? How are you verifying this?