Summary:
Changelog: [Internal]

Fixing a red screen on the RN picker.
Looks like the picker gets confused when  for unknown reasons a native value is undefined. In that case we stick to the JS value as it is specified in the comment.
https://fb.workplace.com/groups/rn.support/permalink/2997783536936908/

NOTE : Native fix was landed, this add an extra layer on the JS side

Reviewed By: mmmulani

Differential Revision: D18443005

fbshipit-source-id: 9511ac90f2d9e6186c6c0de3b673cc535cdb9fa6
This commit is contained in:
Lucy Beatriz Gomez 2019-11-20 20:12:58 -08:00 коммит произвёл Facebook Github Bot
Родитель 9c5b26639a
Коммит a7233e45a4
1 изменённых файлов: 5 добавлений и 1 удалений

Просмотреть файл

@ -115,7 +115,11 @@ class PickerIOS extends React.Component<Props, State> {
// This is necessary in case native updates the picker and JS decides
// that the update should be ignored and we should stick with the value
// that we have in JS.
if (this._picker && this._lastNativeValue !== this.state.selectedIndex) {
if (
this._picker &&
this._lastNativeValue !== undefined &&
this._lastNativeValue !== this.state.selectedIndex
) {
PickerCommands.setNativeSelectedIndex(
this._picker,
this.state.selectedIndex,