Solvedrecyclerlistview RecyclerListView needs to have a bounded size

Hi, I've been trying to use this component following the example in the README but it gives me the following error:

RecyclerListView needs to have a bounded size. Currently height or, width is 0

If I comment these lines it works perfectly:

if (layout.height === 0 || layout.width === 0) {
throw new CustomError(RecyclerListViewExceptions.layoutException);
}

I've logged the values of layout and this._layout and they are {height: 0, width: 0} and {width: 414, x: 0, height: 0, y: 0}` respectively.

The only particularity of my usage is the RecyclerListView is on a TabNavigator. Any idea why this might be happening?

The code of my app is here in case you might want to take a look (it's ReasonML, though :( ) https://github.com/erizocosmico/myfosdem/blob/feature/recyclerlistview/re/components/eventList.re#L90-L140

21 Answers

✔️Accepted Answer

@naqvitalha Just wonder if I can add style={{ minHeight: 1, minWidth: 1 }} to hot fix this error?

Other Answers:

wrap the <RecyclerListView /> inside <View style={{flex:1}}> </View> like below:

<View style={{flex:1}}>
<RecyclerListView />
 </View>

I was able to fix this error by adding in {minHeight: 1, minWidth: 1} and removing the following 2 properties from my container:

justifyContent: 'center',
alignItems: 'center',

More Issues: