Reputation: 43
export const initialState = {
data: [1,2,3]
}
after success api request i am updating data state
data: state.data.concat(...action.data.data)
All the flat list items are getting re-render as concat is returning new array.(onReachEnd i am calling api for next page. and that data needs to added in redux state without updating whole array )
Upvotes: 1
Views: 53
Reputation: 180
You can just destructure both
data : [...state.data, ...action.data.data]
Upvotes: 1