-
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
Some ReactProp names are incorrectly considered ReactPropGroup #17030
Comments
Just tried v0.51.0 (final) and this issue persists. |
I have the same issue. |
Same here. It's impacting my ability to use react-native-linear-gradient and I'm wondering what other side effects this issue may have. If anyone comes up with a workaround, please share. |
This may be related: 38b5506 (iOS is seeing a different symptom than the Android stack trace given in the issue, but it looks like the same bug) |
Same issue here #17122 |
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. |
Is this a bug report?
Yes.
Have you read the Contributing Guidelines?
Yes.
Environment
Environment:
OS: macOS Sierra 10.12.6
Node: 8.5.0
Yarn: 1.2.0
npm: 5.4.2
Watchman: 4.9.0
Xcode: Xcode 9.1 Build version 9B55
Android Studio: 2.3 AI-162.4069837
Packages: (wanted => installed)
react: 16.0.0 => 16.0.0
react-native: 0.51.0-rc.2 => 0.51.0-rc.2
Steps to Reproduce
In RN 0.51.0-rc.2 there appears to be a problem with the properties passed from JS to the native layer. This issue doesn't exist in RN 0.50.0.
When declaring a property with
@ReactProp(name=...)
, certain property names appear to be considered@ReactPropGroup(name=...)
. I came to this conclusion by following the stacktrace included below.My error message in particular is:
TypeError: expected dynamic type 'double', but had type 'array'
This only happens with certain words like "start", "end", "position", etc.
It looks like these properties are inherited from some other object in the native module's hierarchy where they might have been declared with
@ReactPropGroup
.A code example follows (note my inline comments):
Expected Behavior
Property names such as "start" and "end" should be considered the type of property they were declared as (
@ReactProp
, in this case).Actual Behavior
The app crashed with the following stack trace:
Reproducible Demo
git clone git@github.com:tiagoalves/rn-reactprops-issue-sample.git
cd rn-reactprops-issue-sample
yarn
yarn run android
App.js
and change the<SampleModule
as indicated in the code comments and it should not crash anymore (there's no visible indication of success).I detected this issue when updating to the latest RC of RN in module react-native-linear-gradient. My example code is based on that module.
The text was updated successfully, but these errors were encountered: