-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Replace global.alert use to fix eslint warnings #22184
Conversation
Generated by 🚫 dangerJS |
|
||
class AccessibilityIOSExample extends React.Component<{}> { | ||
render() { | ||
return ( | ||
<View> | ||
<View | ||
onAccessibilityTap={() => alert('onAccessibilityTap success')} | ||
onAccessibilityTap={() => Alert.alert('onAccessibilityTap success')} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is almost the same. global's alert sets the title of the alert to "Alert". https://github.com/facebook/react-native/blob/master/Libraries/Core/setUpAlert.js#L20
What's the rationale behind removing reliance on |
I think the intent is to fix the eslint warning which is pretty standard to disallow alert and console calls. I think the question is do we disable the linter for this file, or throughout all of RNTester, or use the Alert module which doesn’t trigger the lint. shrug |
12a9ed9
to
485a216
Compare
The idea is to fix the eslint warning. I'm not pretty sure how, though. I usually use alert and console calls for debugging purposes and I prefer not to disable linting rules, that's why I chose using |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is reasonable. 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RSNara has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@vcalvello merged commit 55994f5 into |
Summary: Replaces `alert` with `Alert.alert` to fix eslint warnings. Pull Request resolved: facebook/react-native#22184 Reviewed By: TheSavior Differential Revision: D13105636 Pulled By: RSNara fbshipit-source-id: 82a9e55fd002051e3cf8238e29d37b2b33f66f0e
Summary: Replaces `alert` with `Alert.alert` to fix eslint warnings. Pull Request resolved: facebook#22184 Reviewed By: TheSavior Differential Revision: D13105636 Pulled By: RSNara fbshipit-source-id: 82a9e55fd002051e3cf8238e29d37b2b33f66f0e
Replaces
alert
withAlert.alert
to fix eslint warnings.Test Plan:
Check
no-alert
lint warning displayed.Changelog:
[INTERNAL] [ENHANCEMENT] - Replace
alert
withAlert.alert
to fix eslint warning.