-
Notifications
You must be signed in to change notification settings - Fork 24.3k
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
Functional components allow to have this
reference
#18942
Comments
In bundled js file, babel declares Since a Object (in this case, In expo snack, it failes because global object is link of a part of bundled JS: https://gist.github.com/syumai/0dbe2d8bcbc17475a211b39ec6ee4241#file-bundle-js-L17 |
Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as "For Discussion" or "Good first issue" and I will leave it open. Thank you for your contributions. |
Should this be fixed? |
Babel has been updated since 0.55.2, does this repro in 0.59? I'm going to close this as the version in the original post is quite old, but if this reproes still in 0.59 then let us know and we can reopen the issue. |
Environment
Environment:
OS: macOS Sierra 10.12.6
Node: 9.10.1
Yarn: 1.5.1
npm: 3.10.10
Watchman: 4.7.0
Xcode: Xcode 9.2 Build version 9C40b
Android Studio: 3.0 AI-171.4443003
Packages: (wanted => installed)
react: 16.3.1 => 16.3.1
react-native: 0.55.2 => 0.55.2
Steps to Reproduce
In React.js, stateless components are not allowed to have
this
reference soExample
would give an error on click.In react-native,
this
unexpectedly behaves like a class property instead.Both the
<Example />
instances share the samethis
, so clicking on one button would incrementthis.count
for both instances.The text was updated successfully, but these errors were encountered: