question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

React Native 0.23.1 warning: 'In next release empty section headers will be rendered'

See original GitHub issue

Since upgrading I’m now getting this error.

My setup looks like this:

<GiftedListView style={{flex:1}}
                                automaticallyAdjustContentInsets={false}
                                rowView={this._renderRow}
                                onFetch={this._loadDataFromNetwork}
                                firstLoader={true}
                                pagination={false}
                                refreshable={true}
                                withSections={false}
                                customStyles={{refreshableView:{backgroundColor: '#FFFFFF'}}}
                                emptyView={this._renderEmptyView}
                                ref="listView"

                />

e.g. I’m using withSections={false}. Any ideas?

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:7

github_iconTop GitHub Comments

83reactions
jeromegrossecommented, Apr 15, 2016

The full error message is: Warning: In next release empty section headers will be rendered. In this release you can use 'enableEmptySections' flag to render empty section headers.

This flag is referenced in the documentation of the ListView. I’m not sure how @FaridSafi would like to solve the issue, but currently it is possible to mute the error passing it the flag, knowing that at some point the flag will be deprecated. Anyways @benvium, as a temporary fix insert the following line while calling GiftedListView: enableEmptySections={true}.

47reactions
eremzeitcommented, May 5, 2016

If empty sections are not desired to be rendered their indices should be excluded from sectionID object.

AFAIK, this is just a confusing way of saying that in the future if you don’t want the headers for empty sections to show up, don’t include that sectionId in the data blob you passed to cloneWithRowsAndSections. If you use cloneWithRows then you don’t have sections and so there’s no issue with section headers showing up. The confusing part is that even if you don’t use sections, it will still throw the warning mentioning sections. In this case, you can just set enableEmptySections={true} and forget about it.

https://github.com/facebook/react-native/blob/master/Libraries/CustomComponents/ListView/ListViewDataSource.js http://moduscreate.com/react-native-listview-with-section-headers/

Read more comments on GitHub >

github_iconTop Results From Across the Web

Warning: Empty section headers will be rendered - React Native
Well the warning already say it all. Just add enableEmptySections to your listview component and the warning is gone.
Read more >
react-native-router-flux/CHANGELOG.md - UNPKG
17, - after update to Release 4.0.2 props not working. ... 33, - Require cycle warnings with React Native 0.57.0 ... 672, -...
Read more >
react-native-router-flux | Yarn - Package Manager
react -native-router-flux is a different API over react-navigation . It helps users to define all the routes in one central place and navigate...
Read more >
Changelog Legend - Saagie Design System
remove warnings for some state updates during Tabs render ... Add release date to changelog ... Update Thumbnail react component to allow children...
Read more >
Changelog | Meteor API Docs
server-render@0.4.1 ... MongoDB Node.js driver Upgrade from 3.6.10 to 4.3.1 ... prefered) until the next minor version, where we will start showing alerts....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found