idibidiart / react-native-responsive-grid

Bringing the Web's Responsive Design to React Native
Other
379 stars 42 forks source link

Not working in FlatList #1

Closed shukerullah closed 7 years ago

idibidiart commented 7 years ago

FlatList depends on React Native 0.43.x which has a peer dependency on React 16 alpha. I'm not sure that React components that use different versions of React can work together.

idibidiart commented 7 years ago

@shukerullah

We actually have another reason besides FlatList to move to React Native 0.43.x

Note

If you'd like to build apps that respond to layout changes (due to device oriehtation and aspect ratio changes or any change in the computed or explicit width of the column), Columns must be contained in a Row.

The technical reason for those interested in the grid's internals is that while rendering Columns is possible without putting them inside a Row, when a Column is unmounted (as in the case where it satisfies a 'hidden' prop condition or does not satisfy an 'aspectRatio' condition) having a Row re-render that column means that the column's conditions will be re-evaluated and the Column may get re-mounted. Otherwise, an unmounted column cannot re-evaluate its conditions. When we move to React Native 0.43.x we'll be able to get rid of this requirement by allowing columns to be 'display: none' but remaining mounted, so they can react to changes in their conditions! It will also allow this grid to be used with FlatList which depends on React Native 0.43.x.

I'm only waiting for React 16 to get out of Alpha. I think Beta would be acceptable.

idibidiart commented 7 years ago

@shukerullah

Migrated to RN 0.43 so it should work now. Please see the updated Readme for minor changes in the API

Feedback is welcome. Closing this for now. Feel free to re-open if it does not play well with FlatList.