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(react): allRoutes cannot triple equal a new array instance #3779

Merged

Conversation

sdemjanenko
Copy link
Contributor

Running === against a newly instantiated array will always return
false. Instead, we should check that allRoutes is empty.

Running `===` against a newly instantiated array will always return
false. Instead, we should check that `allRoutes` is empty.
@AbhiPrasad AbhiPrasad self-requested a review July 6, 2021 20:15
Copy link
Contributor

@kamilogorek kamilogorek left a comment

Choose a reason for hiding this comment

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

LGTM code wise cc @AbhiPrasad for logic check.

Copy link
Member

@AbhiPrasad AbhiPrasad left a comment

Choose a reason for hiding this comment

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

We should write an eslint rule to guard against this

@AbhiPrasad AbhiPrasad merged commit f398340 into getsentry:master Jul 7, 2021
@AbhiPrasad AbhiPrasad changed the title fix: allRoutes cannot triple equal a new array instance fix(react): allRoutes cannot triple equal a new array instance Jul 7, 2021
@sdemjanenko sdemjanenko deleted the fix_all_routes_equality_check branch July 7, 2021 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants