Coder Social home page Coder Social logo

Comments (3)

Ahagan avatar Ahagan commented on July 20, 2024

I receive this too and I am using react 0.55 as well. Previously, the timeline rendered fine.

Visually, it doesn't render at all and get the following message:

Stack strace:

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

  • node_modules/fbjs/lib/warning.js:33:20 in printWarning
  • node_modules/fbjs/lib/warning.js:57:25 in warning
  • node_modules/react-native/Libraries/Lists/ListView/ListView.js:432:12 in ListView_render
  • node_modules/react-native/Libraries/Renderer/ReactNativeRenderer-dev.js:8811:23 in finishClassComponent
  • node_modules/react-native/Libraries/Renderer/ReactNativeRenderer-dev.js:12924:25 in performUnitOfWork

from react-native-timeline-listview.

Ahagan avatar Ahagan commented on July 20, 2024

@neogeno, how was you passing data to the 'data' prop? Previously I passed it a function which mapped my data into the structure required by the component.

I have since moved that logic out to a separate function and invoked it and works fine for me now without the warning messages.

Old way that no longer works for me:
<Timeline data={() => { return [{ title: 'example', description: 'example }] }} />

Extracted way which works:

getData() { return [{ title: 'example', description: 'example }] } render() { <Timeline data={this.getData()} /> }

from react-native-timeline-listview.

alz10 avatar alz10 commented on July 20, 2024

UPDATE: The easiest way is to use options.

<Timeline options={{ enableEmptySections: true }} />

===================================================================

In your project folder find node_modules and then scroll down to find react-native-timeline-listview open that folder and find lib open that too and click on index.js

On the render() find the code below and put enableEmptySections. Check documentation here React-Native ListView

        <ListView
          enableEmptySections
          ref="listView"
          style={[styles.listview, this.props.listViewStyle]}
          dataSource={this.state.dataSource}
          renderRow={this._renderRow}
          showsHorizontalScrollIndicator={false}
          showsVerticalScrollIndicator={false}
          automaticallyAdjustContentInsets={false}
          {...this.props.options}
        />

After that the yellow warning will be gone

from react-native-timeline-listview.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.