react-native-segmented-picker
react-native-segmented-picker copied to clipboard
[BUG] When the number of items is too large, the component will crash
When the number of items is too large, such as 53, the component will crash
Hi there! Thanks for the bug report.
Do you mean the number of columns, or items within that column?
At Ynomia, we've used this component in production to render lists hundreds of lines long and never experienced this on Android or iOS.
Can you please share more about what version of react native you're using, also phone/os version and perhaps some sample code too?
Yes, I mean the number of columns is too large will crash. My react native version is 0.64, Android version is 12.
const years = [2022, 2021, 2020, 2019, 2018, 2017, 2016, 2015, 2014, 2013, 2012, 2011, 2010, 2009, 2008, 2007, 2006, 2005, 2004, 2003, 2002, 2001,2000,1999,1998,1997,1996,1995,1994,,1993,1992,1991,1990,1989,1988,1987,1986,1985,1984,1983,1982,1981,1980,1979,1978,1977,1976,1975,1974,1973,1972,1971,1970];
<SegmentedPicker
visible={yearVisible}
onConfirm={onYearChange}
options={[{
key: 'col_1',
items: years.map(y => ({
label: String(y),
value: y,
})),
}]}
/>
When I reduce the number of columns to 23, there will be no such problem.