DEV Community

Discussion on: Using Firebase with React Hooks

Collapse
 
tomasb profile image
TomasB

I think this:

      // returning the unsubscribe function will ensure that
      // we unsubscribe from document changes when our id
      // changes to a different value.
      return () => unsubscribe()

should be like that:

return unsubscribe;

Or am I missing something here?