gusparis / react-native-month-year-picker

React Native Month Picker component for iOS & Android
MIT License
105 stars 73 forks source link

iOS: Not showing Done and Cancel Button on first render, scroll the spin crash the app #92

Closed cengit closed 2 years ago

cengit commented 2 years ago

React Native version :0.63.3

as it would crash the app, I guess is there some code issue in this situation?

attached the screen and video. thanks

https://user-images.githubusercontent.com/3691806/128285145-d03f9387-22a6-4db9-9953-541155dea3a0.MP4

image

this is my code:

render() {
    const { value, minimumDate, maximumDate, locale } = this.state;
    return (
      <MonthPicker
        onChange={this.onValueChange}
        value={value}
        minimumDate={minimumDate}
        maximumDate={maximumDate}
        mode="full"
        autoTheme={false}
        locale={locale}
      />
    );
  }
cengit commented 2 years ago

I found the root cause: when the locale=null, it would reproduce above issue

use below code would fix the problem.

<MonthPicker
        onChange={this.onValueChange}
        value={value}
        minimumDate={minimumDate}
        maximumDate={maximumDate}
        mode="full"
        autoTheme={false}
        locale={locale || 'en'}
      />

closing the issue