{"action":"created","issue":{"url":"https://api.github.com/repos/reactjs/react-redux/issues/671","repository_url":"https://api.github.com/repos/reactjs/react-redux","labels_url":"https://api.github.com/repos/reactjs/react-redux/issues/671/labels{/name}","comments_url":"https://api.github.com/repos/reactjs/react-redux/issues/671/comments","events_url":"https://api.github.com/repos/reactjs/react-redux/issues/671/events","html_url":"https://github.com/reactjs/react-redux/issues/671","id":221402682,"number":671,"title":"No errors caught when a state change triggers re-render","user":{"login":"danielrs","id":1887507,"avatar_url":"https://avatars2.githubusercontent.com/u/1887507?v=3","gravatar_id":"","url":"https://api.github.com/users/danielrs","html_url":"https://github.com/danielrs","followers_url":"https://api.github.com/users/danielrs/followers","following_url":"https://api.github.com/users/danielrs/following{/other_user}","gists_url":"https://api.github.com/users/danielrs/gists{/gist_id}","starred_url":"https://api.github.com/users/danielrs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielrs/subscriptions","organizations_url":"https://api.github.com/users/danielrs/orgs","repos_url":"https://api.github.com/users/danielrs/repos","events_url":"https://api.github.com/users/danielrs/events{/privacy}","received_events_url":"https://api.github.com/users/danielrs/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-04-12T21:59:54Z","updated_at":"2017-04-12T23:25:37Z","closed_at":null,"body":"Basically what the title says. I'm using `react-redux` in my `react-native` app. I was having some problems with some bugs without any errors at all. After messing with the code I managed to find the cause for the problems I'm having:\r\n\r\n```js\r\nimport React, { Component } from 'react';                                                                                  \r\nimport { Button, Text, View } from 'react-native';\r\nimport { connect } from 'react-redux';\r\n\r\nimport DivisionAction from '../../actions/division';\r\n\r\nclass DivisionIndexView extends Component {\r\n  constructor(props) {\r\n    super(props);\r\n    this.state = {showNumbers: false};\r\n  }\r\n\r\n  componentDidMount() {\r\n    const { dispatch } = this.props;\r\n    dispatch(DivisionAction.requestDivisions());\r\n  }\r\n\r\n  _handlePress = () => {\r\n    this.setState({showNumbers: !this.state.showNumbers});\r\n  }\r\n\r\n  render() {\r\n    let nums = []; \r\n    // >>> CHECKPOINT 1\r\n    if (this.state.showNumbers) nums = [1, 2, 3]; \r\n    const numbers = nums.map((n) =>\r\n        // >>> CHECKPOINT 2\r\n        <DoesnExists key={n}>{n}</DoesnExists>\r\n    );  \r\n\r\n    return (\r\n      <View>\r\n        <Button title=\"Toggle numbers\" onPress={this._handlePress} />\r\n        {numbers}\r\n      </View>\r\n    );  \r\n  }\r\n}\r\n\r\nconst mapStateToProps = (state) => {\r\n  // state.division reducer has a boolean `loaded` field.\r\n  return state.division;\r\n}\r\n\r\nexport default connect(mapStateToProps)(DivisionIndexView);\r\n```\r\n\r\nThe previous code triggers an error when you press the button. Each time the button is pressed, state.showNumbers changes between `true` and `false`; when it is true, it makes the array `nums` (CHECKPOINT 1) equal to some elements which are then used to render the non-existing element `<DoesntExits>...</DoesnExists>` (CHECKPOINT 2).\r\n\r\nThe previous error is expected, however, if I change `this.state.showNumbers` at CHECKPOINT 1 to `this.props.loaded`, I get no errors at all, the element just doesn't render.\r\n\r\n**I'm not sure** if this error is caused by `react-redux`, however, that seems to be the case. Maybe the way `react-redux` triggers a re-render is conflicting in some way?"},"comment":{"url":"https://api.github.com/repos/reactjs/react-redux/issues/comments/293734931","html_url":"https://github.com/reactjs/react-redux/issues/671#issuecomment-293734931","issue_url":"https://api.github.com/repos/reactjs/react-redux/issues/671","id":293734931,"user":{"login":"markerikson","id":1128784,"avatar_url":"https://avatars2.githubusercontent.com/u/1128784?v=3","gravatar_id":"","url":"https://api.github.com/users/markerikson","html_url":"https://github.com/markerikson","followers_url":"https://api.github.com/users/markerikson/followers","following_url":"https://api.github.com/users/markerikson/following{/other_user}","gists_url":"https://api.github.com/users/markerikson/gists{/gist_id}","starred_url":"https://api.github.com/users/markerikson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markerikson/subscriptions","organizations_url":"https://api.github.com/users/markerikson/orgs","repos_url":"https://api.github.com/users/markerikson/repos","events_url":"https://api.github.com/users/markerikson/events{/privacy}","received_events_url":"https://api.github.com/users/markerikson/received_events","type":"User","site_admin":false},"created_at":"2017-04-12T23:25:37Z","updated_at":"2017-04-12T23:25:37Z","body":"I'm sorry, I'm very unclear on what's going on here.  What error are you seeing, specifically, or at least expecting to occur?  Can you create an example that reproduces the problem?"}}
{"actor":{"display_login":"markerikson"}}