Skip to content
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

(0.62) Exception thrown any time pickers are imported #4597

Closed
NickGerleman opened this issue Apr 14, 2020 · 1 comment · Fixed by #4613
Closed

(0.62) Exception thrown any time pickers are imported #4597

NickGerleman opened this issue Apr 14, 2020 · 1 comment · Fixed by #4613

Comments

@NickGerleman
Copy link
Collaborator

We see an invariant violation on pages with pickers due to RCTPicker being registered twice. We've seen a similar issue during the 0.62 upgrade for ScrollView that required taking in some new JS-side changes for code that only happens off of Android/iOS.

@ghost ghost added the Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) label Apr 14, 2020
@NickGerleman NickGerleman added this to the 0.62 (M5) milestone Apr 14, 2020
@NickGerleman NickGerleman added bug must-have p1 Area: Picker and removed Needs: Triage 🔍 New issue that needs to be reviewed by the issue management team (label applied by bot) labels Apr 14, 2020
@NickGerleman NickGerleman self-assigned this Apr 14, 2020
@NickGerleman NickGerleman changed the title Exception thrown any time pickers are imported (0.62) Exception thrown any time pickers are imported Apr 14, 2020
@NickGerleman
Copy link
Collaborator Author

Looks like this is actually just for PickerWindows/DatePicker. Root cause is simply requiring RCTPicker in multiple files. Should be an easy fix.

NickGerleman added a commit to NickGerleman/react-native-windows that referenced this issue Apr 15, 2020
Fixes microsoft#4597

Our implementation of Picker is a bit deformed. In Stock React Native, Picker.js will delegate to PickerAndroid and PickerIOS. In Windows, we the two are copy pasted. In 0.62, invariants are added to prevent duplicate view manager registration. We run into issues with this with Picker, since our copies will both call requireNativeComponent. This change modifies the normal picker to delegate to PickerWindows to work correctly from the stock picker. I.e. The stock picker's child views are meant for data only and will throw if rendered, where the Windows version's are included but used to noop render.

Picker is getting lean-cored, so I didn't invest much into fixing PickerWindow's isssues, converting to Flow, NativeComponent strucutre, etc.

Validated Picker, PickerWindows, DatePicker RNTester pages work correctly.
NickGerleman added a commit that referenced this issue Apr 15, 2020
* Fix PickerWindows (and DatePickerExample Page)

Fixes #4597

Our implementation of Picker is a bit deformed. In Stock React Native, Picker.js will delegate to PickerAndroid and PickerIOS. In Windows, we the two are copy pasted. In 0.62, invariants are added to prevent duplicate view manager registration. We run into issues with this with Picker, since our copies will both call requireNativeComponent. This change modifies the normal picker to delegate to PickerWindows to work correctly from the stock picker. I.e. The stock picker's child views are meant for data only and will throw if rendered, where the Windows version's are included but used to noop render.

Picker is getting lean-cored, so I didn't invest much into fixing PickerWindow's isssues, converting to Flow, NativeComponent strucutre, etc.

Validated Picker, PickerWindows, DatePicker RNTester pages work correctly.

* Change files
asklar pushed a commit to asklar/react-native-windows that referenced this issue Apr 19, 2020
* Fix PickerWindows (and DatePickerExample Page)

Fixes microsoft#4597

Our implementation of Picker is a bit deformed. In Stock React Native, Picker.js will delegate to PickerAndroid and PickerIOS. In Windows, we the two are copy pasted. In 0.62, invariants are added to prevent duplicate view manager registration. We run into issues with this with Picker, since our copies will both call requireNativeComponent. This change modifies the normal picker to delegate to PickerWindows to work correctly from the stock picker. I.e. The stock picker's child views are meant for data only and will throw if rendered, where the Windows version's are included but used to noop render.

Picker is getting lean-cored, so I didn't invest much into fixing PickerWindow's isssues, converting to Flow, NativeComponent strucutre, etc.

Validated Picker, PickerWindows, DatePicker RNTester pages work correctly.

* Change files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant