Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(core): removal of non-existing listener should not break updating navigation container ref #10067

Merged
merged 1 commit into from Jan 29, 2022

Conversation

split
Copy link
Contributor

@split split commented Oct 20, 2021

Calling removeListener on event that doesn't have any listeners will add new key for that event to listeners with value undefined. After that attempts to set ref.current will fail with "Cannot read property 'forEach' of undefined" error. Fix is quite simple. Just needed to add check if there is listeners for the given event.

FYI @satya164. This is related to your recent change acdde18

@github-actions
Copy link

Hey split! Thanks for opening your first pull request in this repo. If you haven't already, make sure to read our contribution guidelines.

@netlify
Copy link

netlify bot commented Oct 20, 2021

✔️ Deploy Preview for react-navigation-example ready!

🔨 Explore the source changes: 464d058

🔍 Inspect the deploy log: https://app.netlify.com/sites/react-navigation-example/deploys/6170319a026d9a0007d567a7

😎 Browse the preview: https://deploy-preview-10067--react-navigation-example.netlify.app/

Copy link
Member

@satya164 satya164 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you

@satya164 satya164 merged commit d206ffe into react-navigation:main Jan 29, 2022
MohamedLamineAllal pushed a commit to MohamedLamineAllal/react-navigation that referenced this pull request Feb 4, 2022
…eact-navigation#10067)

Calling `removeListener` on event that doesn't have any listeners will add new key for that event to listeners with value `undefined`. After that attempts to set `ref.current` will fail with "Cannot read property 'forEach' of undefined" error. Fix is quite simple. Just needed to add check if there is listeners for the given event.

FYI @satya164. This is related to your recent change react-navigation@acdde18
MohamedLamineAllal pushed a commit to MohamedLamineAllal/react-navigation that referenced this pull request Feb 4, 2022
…eact-navigation#10067)

Calling `removeListener` on event that doesn't have any listeners will add new key for that event to listeners with value `undefined`. After that attempts to set `ref.current` will fail with "Cannot read property 'forEach' of undefined" error. Fix is quite simple. Just needed to add check if there is listeners for the given event.

FYI @satya164. This is related to your recent change react-navigation@acdde18
MohamedLamineAllal pushed a commit to MohamedLamineAllal/react-navigation that referenced this pull request Feb 4, 2022
…eact-navigation#10067)

Calling `removeListener` on event that doesn't have any listeners will add new key for that event to listeners with value `undefined`. After that attempts to set `ref.current` will fail with "Cannot read property 'forEach' of undefined" error. Fix is quite simple. Just needed to add check if there is listeners for the given event.

FYI @satya164. This is related to your recent change react-navigation@acdde18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants