Skip to content

Update App.tsx custom global variable declaration #133

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

Merged
merged 1 commit into from
Apr 13, 2020
Merged

Update App.tsx custom global variable declaration #133

merged 1 commit into from
Apr 13, 2020

Conversation

leotm
Copy link
Contributor

@leotm leotm commented Apr 13, 2020

Summary

Our custom global variable would be nicer declared as a const.

var doesn't seem to present any advantages here.

Functionality-wise the block scope remains the same as the global scope.

Semantic-wise it's clear it is global as @emin93 already moved it below imports.

Also ib4 wave of ESLint no-var adopters (e.g. gabts/eslint-config-react-native-typescript)

Further: https://eslint.org/docs/rules/no-var#when-not-to-use-it

Test Plan

What's required for testing (prerequisites)?

What are the steps to reproduce (after prerequisites)?

  • yarn lint

Compatibility

OS Implemented
iOS ✅❌
Android ✅❌

Our custom global variable would be nicer declared as a `const`.

`var` doesn't seem to present any advantages here.

Functionality-wise the block scope remains the same as the global scope.

Semantic-wise it's clear it is global as @emin93 already moved it below imports.

Also ib4 wave of ESLint `no-var` adopters (e.g. https://github.com/gabts/eslint-config-react-native-typescript).

Further, see: https://eslint.org/docs/rules/no-var#when-not-to-use-it
@leotm leotm requested review from emin93 and radko93 as code owners April 13, 2020 14:24
Copy link
Collaborator

@radko93 radko93 left a comment

Choose a reason for hiding this comment

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

This makes sense, of course, thanks!

@radko93 radko93 merged commit 2c8213c into react-native-community:master Apr 13, 2020
@leotm leotm deleted the patch-2 branch April 13, 2020 20:53
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.

2 participants