Skip to content
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

[ListView] swallows render error #1965

Closed
fabiomcosta opened this issue Jul 12, 2015 · 2 comments
Closed

[ListView] swallows render error #1965

fabiomcosta opened this issue Jul 12, 2015 · 2 comments
Labels
Good first issue Interested in collaborating? Take a stab at fixing one of these issues. Resolution: Locked This issue was locked by the bot.

Comments

@fabiomcosta
Copy link

When an error happens inside ListView's renderRow property the error is swallowed and never shown on the RedBox.
Ex:

<ListView
  renderRow={() => <TouchableHighlight><Text>a</Text><Text>b</Text></TouchableHighlight>}
  dataSource={dataSource}
/>

Because TouchableHighlight accepts only one child, there should be an error thrown, but what happens is that no item from the dataSource is ever rendered.

I'm using v0.7.1

@brentvatne brentvatne changed the title ListView swallows render error [ListView] swallows render error Jul 20, 2015
@brentvatne
Copy link
Collaborator

@fabiomcosta - do you have a chance to submit a PR for this? It would be great 😄

@brentvatne brentvatne added the Good first issue Interested in collaborating? Take a stab at fixing one of these issues. label Jul 20, 2015
@boourns
Copy link

boourns commented Sep 21, 2015

While debugging a similar error, I tried reproducing this error using the example given in the PR description. It looks like it's now fixed on react-native 0.11.0 and errors are not swallowed:

index.ios.js:

var ListViewBug = React.createClass({
  render: function() {
    var ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1 !== r2});

    return (
      <ListView
        renderRow={() => <TouchableHighlight><Text>a</Text><Text>b</Text></TouchableHighlight>}
        dataSource={ds.cloneWithRows(['row 1', 'row 2'])}
      />
    );
  }
});

output (as expected):
image

so @brentvatne I think this issue can be closed now

@ide ide closed this as completed Sep 21, 2015
@facebook facebook locked as resolved and limited conversation to collaborators Jul 22, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Good first issue Interested in collaborating? Take a stab at fixing one of these issues. Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants