-
Notifications
You must be signed in to change notification settings - Fork 424
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redux issue #68
Comments
I put a log at (r1, r2) => {
console.log('r1, r2',r1, r2,r1 !== r2);
return r1 !== r2;
} I understand that always r1 and r2 is repeated to and |
Only keep data in Redux store and create DataProvider inside the component that renders RecyclerListView. When data changes simply create a new one. Don't have it inside the store, that will solve it. |
@naqvitalha DataProvider is not in store and is in connect , I tried inside component too , But not working |
Please clone and run this https://github.com/sm2017/issue-68 In this line https://github.com/sm2017/issue-68/blob/master/src/App.js#L7 , I just put data as initial sate , we never ever change state in this example https://github.com/sm2017/issue-68/blob/master/src/flights/FlightsPage.js#L90-L98 I add dataProvider to props and if state change new dataProvider is created As you can see https://github.com/sm2017/issue-68/blob/master/src/flights/FlightData.js#L13 we have only one Green_circle Icon , But if you scroll down , you can see duplicated |
@naqvitalha I see that https://github.com/naqvitalha/travelMate without redux has same issue , Please run https://github.com/naqvitalha/travelMate when you change FlighData with Green_circle Icon |
with redux |
in the example if you use this methods yo can see that error
if you use it with setTimeout
|
@sm2017 I checked the travelMate code, if you look at the bottom I'm using concat to make list longer. This will duplicate object references and cause the issue. I've fixed it can you try and repro now? |
@naqvitalha ok thanks I will use it |
@vvmgev Use initialRenderOffset or initialRenderIndex while mounting. Make sure you don't mount with empty data to fully leverage it. |
@naqvitalha thanks |
@naqvitalha My problem is solved , I can use Redux without issue |
@sm2017 can you let us know your findings so that it may help others with similar issue. |
I have just a mistake , actually this code works well const mapStateToProps = state => {
return {
dataProvider: new DataProvider((r1, r2) => {
return r1 !== r2
}).cloneWithRows(state)
}
} |
Great. |
I have an issue as same as #60 but in both android and iOS (I think the problem is not depends on OS)
My
rowRenderer
return an element connected to redux and I need to use redux , and I putdataProvider
in themapStateToProps
Can you please provide an example that show how we can use this library with redux?
The text was updated successfully, but these errors were encountered: