In D7525 I forgot to include code that unsubscribes on unmount - this may cause some issues when a user logs out, then logs in and clicks a link.
Details
- Reviewers
bartek kamil inka - Commits
- rCOMM7c38edf5ea5d: [native] Unsubscribe listener on unmount
Log out, log in, click a link - it should work.
Diff Detail
- Repository
- rCOMM Comm
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
native/navigation/invite-link-handler.react.js | ||
---|---|---|
39 ↗ | (On Diff #26248) | I'm not sure how the situation looks now, but I remember Hermes had problems with this construct, hooks weren't firing properly and I had lots of trouble debugging this. The solution was to use curly braces instead of a void-returning expression. Could you check if this works correctly now? By e.g. const foo = () => { console.log('unmount'); }; // in hook return () => foo(); Or simply apply the suggestion without investigation, to save time |
native/navigation/invite-link-handler.react.js | ||
---|---|---|
39 ↗ | (On Diff #26248) | Is there a reason we can't just return subscription.remove? Is this not bound for it? |
native/navigation/invite-link-handler.react.js | ||
---|---|---|
39 ↗ | (On Diff #26248) |
Yes, Flow is complaining
@bartek I'm applying your suggestion. Wondering what were the issues you've faced. |
native/navigation/invite-link-handler.react.js | ||
---|---|---|
39 ↗ | (On Diff #26248) | Should probably work too |