Comments (16)
with redux
when i use methods of life cycle and in the method I do dispatch
example like this
this.props.setImages([], 0)
i get this error
ExceptionsManager.js:65 TypeError: Cannot read property 'reLayoutFromIndex' of undefined
from recyclerlistview.
I have just a mistake , actually this code works well
const mapStateToProps = state => {
return {
dataProvider: new DataProvider((r1, r2) => {
return r1 !== r2
}).cloneWithRows(state)
}
}
from recyclerlistview.
I put a log at rowHasChanged
of dataProvider
(r1, r2) => {
console.log('r1, r2',r1, r2,r1 !== r2);
return r1 !== r2;
}
I understand that always r1 and r2 is repeated to and r1 !== r2
is always false
, I change rowHasChanged
to (r1, r2) => {return true}
just for testing , but not solved
from recyclerlistview.
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.
If this doesn't help it would be simpler if you can repro the issue on snack so that I can take a look. Here @Flipkart we already use RecyclerListView with Redux.
from recyclerlistview.
@naqvitalha DataProvider is not in store and is in connect , I tried inside component too , But not working
I will provide simple repro within an hour
from recyclerlistview.
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
from recyclerlistview.
@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
from recyclerlistview.
in the example if you use this methods yo can see that error
componentDidMount() {
this.setState({
dataProvider: this.dataProvider.cloneWithRows(this._generateArray(3))
})
}
if you use it with setTimeout
its working
componentDidMount() {
setTimeout(() => {
this.setState({
dataProvider: this.dataProvider.cloneWithRows(this._generateArray(3))
})
},2000)
}
from recyclerlistview.
@vvmgev Try version 1.2.0-beta.4 ... Should be fine. But know that version is under testing right now.
@sm2017 I'm looking into your issue. Will get back.
from recyclerlistview.
@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?
from recyclerlistview.
@naqvitalha ok thanks I will use it
and I have a small question
Now I can set the scroll position when initializing, like scrollTo function
from recyclerlistview.
@vvmgev Use initialRenderOffset or initialRenderIndex while mounting. Make sure you don't mount with empty data to fully leverage it.
from recyclerlistview.
@naqvitalha thanks
from recyclerlistview.
@naqvitalha My problem is solved , I can use Redux without issue
from recyclerlistview.
@sm2017 can you let us know your findings so that it may help others with similar issue.
from recyclerlistview.
Great.
from recyclerlistview.
Related Issues (20)
- forceNonDeterministicRendering is not working when using different View_Types
- The focused row index is different from onVisibleIndicesChanged HOT 1
- Support for multiple viewability config
- 🅱️ Horizontal List Bug (Layout Problem for height not updated correctly) HOT 1
- `testID` & `accessibilityLabel` properties are not supported on recyclerlistview and it's elements?
- numColumns BUG HOT 5
- can not hide the scroll bar HOT 1
- Internal length of list? HOT 1
- compile error
- Recycerlistview renderItem function is rendering half of the item
- How can i render kind of skeleton placeholder items instead of whitespaces/blank?
- TouchableHighlight object inside a RecyclerListView Losing Focus on fast key navigation with React Native TVOS
- How can I interact with the latest selected row?
- Glitch issue when use ScrollViewWithHeader with GridLayoutProvider HOT 1
- useBottomSheetDynamicSnapPoints is deprecated
- Somebody help me!!! /core/RecyclerListView.js: Property id of VariableDeclarator expected node to be of a type ["LVal"] but instead got "BooleanLiteral" HOT 2
- npm run build is failing HOT 3
- Web accessibility: focus order is wrong.
- contextProvider offset does not work in apps with StrictMode enabled
- New architecture support HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from recyclerlistview.