-
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
Disabling remote debugging impacts Array creation #16807
Comments
What are you trying to achieve here with |
I worked around this by not making a range like a lemon, rather just use syntactic sugar or a lib like lodash :p |
I just has the same issue Environment: OS: macOS Sierra 10.12.6 Packages: (wanted => installed) Target Platform: Android This does not work const headers = [...Array(this.props.numHeaders).keys].map((i) => {
return `Header ${i + 1}`;
}); While this seems to work fine const headers = Array.from(new Array(this.props.numHeaders), (_, i) => {
return `Header ${i + 1}`;
}); |
Seems to be that there is a problem with the As a workaround, you could replace
https://stackoverflow.com/a/20066663 Both get the same result: At least it worked for me. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions. |
I can confirm that this issue still occurs in react-native 0.53.0 + android. |
Thanks for posting this! It looks like you may not be using the latest version of React Native, v0.53.0, released on January 2018. Can you make sure this issue can still be reproduced in the latest version? I am going to close this, but please feel free to open a new issue if you are able to confirm that this is still a problem in v0.53.0 or newer. |
I'm still seeing this using |
Been trying to solve this issue for two days straight, had me refactoring my code trying to find the issue. I'm so greatful! |
Is this a bug report?
Yes
Have you read the Contributing Guidelines?
Yes
Environment
Environment:
OS: Linux 4.10
Node: 8.6.0
Yarn: 1.1.0
npm: 5.3.0
Watchman: 4.9.0
Xcode: N/A
Android Studio: Not Found
Packages: (wanted => installed)
react: 16.0.0 => 16.0.0
react-native: 0.50.3 => 0.50.3
Target Platform: Android
Steps to Reproduce
Enabling or disabling remote debugging on android seems to impact a specific Array creation method.
[...Array(2).keys()].map(i => create a view)
Expected Behavior
I expected
[...Array(2).keys()]
to evaluate exactly the same whilst debugging or not.Actual Behavior
I used the above array creation method to spawn animations at differing frequencies. I noticed that the animation would not render on android if remote debugging was disabled. I tried adding the
perspective
style prop, as advised in the docs, but to no avail. I also tried using native driver for animations, and of course also tried not using native driver. Eventually, I tracked the issue down to the simple array creation not evaluating correctly if remote debugging is disabled.The issue does not appear to affect iOS.
Reproducible Demo
The bug is reproducible with the following component, just stick it in a react native app somewhere.
by default, remote debugging is disabled so initially the animation will not render. If you enable remote debugging, you should see the animation appear.
The text was updated successfully, but these errors were encountered: