Removing a listener from firestorm
Last updated
Was this helpful?
Last updated
Was this helpful?
In react, if you attach a listener for realtime updates when a component mounts, you'd need to remove it when the component amounts.
Failing to do so could raise an error if you delete that item and there's a listener that is still associated with it.
if using React hooks, you use useEffect
and return a function to do the clean up. See the React docs for more details on the equivalent syntax to componentWillUnmount
TODO: Add code example