Hi all,
I have developed a custom functional component by extending the EXB 1.16. My widget allows the user to interactively apply a definition query on one of the map layers. I would like the restore the map layer to its original state when the use closes the widget.
I thought I would be able to use the useEffect hook as follows
useEffect(() => {
console.log('component setup')
//any widget initialisation code
return () => {
console.log('component clean up')
//restore layer to its original state when user closes widget
}
},[])
where component clean up code runs when the widget/component is closed by the user. It looks like the return function is not being called when I close the widget.
Is there another way I can achieve this using react functional components?
Regards,