react-native-flatlist

FlatList renderItem error, TypeError: undefined (evaluating 'item.id')

放肆的年华 提交于 2020-12-15 06:18:28
问题 I have a FlatList where I put some data in from my database. In the render method, the state.data is correctly displayed when I console.log it. But in the renderItem method I try to print the item object but it doesn't display and then the error appears: TypeError: undefined is not an object (evaluating 'item.id') This error is located at: in VirtualizedList (at FlatList.js:662) in FlatList (at PlanView.js:49) in RCTView (at View.js:44) in TestLocalisation (at App.js:9) in App (at

React Native: optimizing flatlist render item with useCallback

别来无恙 提交于 2020-12-11 05:21:03
问题 I am trying to figure out as many ways as possible to optimize flatlist since my flatlist component complains my flat list items takes too long to render (I am already using removeClippedSubviews, windowSize, maxToRenderPerBatch, React.memo etc.). Is it good idea to wrap render function with useCallback? For example, lets say I have function component originally in form: const FlatListItem = ({ color1, color2, color3, color4 }) => { function renderViewWithColorLogic(color) { // do some

React Native: optimizing flatlist render item with useCallback

让人想犯罪 __ 提交于 2020-12-11 05:20:42
问题 I am trying to figure out as many ways as possible to optimize flatlist since my flatlist component complains my flat list items takes too long to render (I am already using removeClippedSubviews, windowSize, maxToRenderPerBatch, React.memo etc.). Is it good idea to wrap render function with useCallback? For example, lets say I have function component originally in form: const FlatListItem = ({ color1, color2, color3, color4 }) => { function renderViewWithColorLogic(color) { // do some

React Native: optimizing flatlist render item with useCallback

末鹿安然 提交于 2020-12-11 05:20:35
问题 I am trying to figure out as many ways as possible to optimize flatlist since my flatlist component complains my flat list items takes too long to render (I am already using removeClippedSubviews, windowSize, maxToRenderPerBatch, React.memo etc.). Is it good idea to wrap render function with useCallback? For example, lets say I have function component originally in form: const FlatListItem = ({ color1, color2, color3, color4 }) => { function renderViewWithColorLogic(color) { // do some

React Native: optimizing flatlist render item with useCallback

大憨熊 提交于 2020-12-11 05:20:28
问题 I am trying to figure out as many ways as possible to optimize flatlist since my flatlist component complains my flat list items takes too long to render (I am already using removeClippedSubviews, windowSize, maxToRenderPerBatch, React.memo etc.). Is it good idea to wrap render function with useCallback? For example, lets say I have function component originally in form: const FlatListItem = ({ color1, color2, color3, color4 }) => { function renderViewWithColorLogic(color) { // do some