-
Notifications
You must be signed in to change notification settings - Fork 185
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
Error on setState and re-render when using Cell #19
Comments
I can't reproduce. Are you sure that you are not submitting empty cell array? Anyway, i've updated demos for custom cells in Example1 with setState usage while trying to reproduce the error, so you may send me PR to reproduce the problem. |
Hi there, This only happens when the cell size changes on setState. I can reproduce it in the following example
|
I'm trying to fix this issues, but without success - unfortunately RN doesn't call 'removeReactView' when some cells are deleted, so i can't handle it properly - i.e. remove cells from table view. One possible way is to override setReactFrame - it is recalled when cells are changed, but when I'm deleting cells there, some weird race-condition occurs - so it is not good idea.. If you could fix it, PR is welcome. |
I too am having this problem, while implementing a simple search/filter feature. Once a search is in place that would reduce the number of Cells, I get the above error. |
Error still occurring :( is there a chance for a fix? |
@nyura123 I completely forgot about that. I'm using it now, however I can't figure out how to make the height any bigger. |
are you setting the height prop on the Item? Unfortunately there's no way On Mon, Aug 8, 2016 at 9:50 PM, Paul Sauve notifications@github.com wrote:
|
@nyura123 Thanks! Setting the height manually works perfectly. I'm still getting the TableView cut off, but it happens with other components too now so I'm thinking it's an issue with my code. Thanks for the help. |
This is likely to happen if you're using some native components, where some ViewManager returns a LayoutShadowNode in createShadowNodeInstance of ViewGroupManager or something extending ReactShadowNode in createShadowNodeInstance of ViewManager on Android, and a RCTShadowView in the shadowView method of RCTViewManager on iOS. But, returns null/nil for some other View in some other ViewManager. Then, if you combine children of both types in the same parent, and any of the elements without shadowViews/Nodes come before the changing number of elements which do have shadowViews/Nodes, then the indices won't match up, and the RCTUIManager on iOS and NativeViewHierarchyManager on Android will choke and produce these exceptions. I solved a similar issue in react-native-svg recently, by making all the ViewManagers return values rather than null/nil. facebook/react-native#23350 |
setState and re-rendering works when you use
<Item></Item>
but when i use<Cell>
, i get the following errorMy render function looks like this
The text was updated successfully, but these errors were encountered: