The team is now working on the WordPress Interactivity API. This unblocks the same UX Frontity framework enabled but directly in WordPress Core, fully compatible with the new Site Editor.
using useEffect() i am getting a warning when i try to set something in state .
Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.
in Unknown
What i am trying to do?
fetching data from an external source after user is authenticated and landed on dashboard.
luisherranz3
Could you please share the code of that component?
useEffect(() => {
let didCancel = false;
// ...
// you can check didCancel
// before running any setState
// ...
return () => {
didCancel = true; // This function is executed on unmount.
};
}, []);