{"action":"created","issue":{"url":"https://api.github.com/repos/react-native-community/react-native-tab-view/issues/248","repository_url":"https://api.github.com/repos/react-native-community/react-native-tab-view","labels_url":"https://api.github.com/repos/react-native-community/react-native-tab-view/issues/248/labels{/name}","comments_url":"https://api.github.com/repos/react-native-community/react-native-tab-view/issues/248/comments","events_url":"https://api.github.com/repos/react-native-community/react-native-tab-view/issues/248/events","html_url":"https://github.com/react-native-community/react-native-tab-view/issues/248","id":228445812,"number":248,"title":"Method onRequestChangeTab not called?","user":{"login":"namdq1969","id":9479593,"avatar_url":"https://avatars2.githubusercontent.com/u/9479593?v=3","gravatar_id":"","url":"https://api.github.com/users/namdq1969","html_url":"https://github.com/namdq1969","followers_url":"https://api.github.com/users/namdq1969/followers","following_url":"https://api.github.com/users/namdq1969/following{/other_user}","gists_url":"https://api.github.com/users/namdq1969/gists{/gist_id}","starred_url":"https://api.github.com/users/namdq1969/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/namdq1969/subscriptions","organizations_url":"https://api.github.com/users/namdq1969/orgs","repos_url":"https://api.github.com/users/namdq1969/repos","events_url":"https://api.github.com/users/namdq1969/events{/privacy}","received_events_url":"https://api.github.com/users/namdq1969/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-05-13T03:29:05Z","updated_at":"2017-05-17T09:09:51Z","closed_at":"2017-05-17T09:09:51Z","body":"I try 2 things:\r\n- put a console.log() inside onRequestChangeTab, but it will never be called.\r\n- remove this onRequestChangeTab props from TabViewAnimated and it warns me this method is required by default.\r\nPlease check this issue for me. Thanks."},"comment":{"url":"https://api.github.com/repos/react-native-community/react-native-tab-view/issues/comments/302031984","html_url":"https://github.com/react-native-community/react-native-tab-view/issues/248#issuecomment-302031984","issue_url":"https://api.github.com/repos/react-native-community/react-native-tab-view/issues/248","id":302031984,"user":{"login":"satya164","id":1174278,"avatar_url":"https://avatars1.githubusercontent.com/u/1174278?v=3","gravatar_id":"","url":"https://api.github.com/users/satya164","html_url":"https://github.com/satya164","followers_url":"https://api.github.com/users/satya164/followers","following_url":"https://api.github.com/users/satya164/following{/other_user}","gists_url":"https://api.github.com/users/satya164/gists{/gist_id}","starred_url":"https://api.github.com/users/satya164/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/satya164/subscriptions","organizations_url":"https://api.github.com/users/satya164/orgs","repos_url":"https://api.github.com/users/satya164/repos","events_url":"https://api.github.com/users/satya164/events{/privacy}","received_events_url":"https://api.github.com/users/satya164/received_events","type":"User","site_admin":false},"created_at":"2017-05-17T09:09:51Z","updated_at":"2017-05-17T09:09:51Z","body":"> when I setState({index: this.state.index + 1}) new tab will be rendered, but there's no console.log in onRequestChangeTab.\r\n\r\n`onRequestChangeTab` only fires when you swipe/tap on tab bar etc. .i.e when the library requests you to change the index in state. If you're doing a `setState` with an index, `onRequestChangeTab` will not fire.\r\n\r\nIf you need to know when the tab changed regardless who did it, try in `componentWillUpdate` or `componentDidUpdate`\r\n\r\n```js\r\ncomponentDidUpdate(prevProps, prevState) {\r\n  if (prevState.index !== this.state.index) {\r\n    console.log(\"Tab changed to:\", this.state.index);\r\n  }\r\n}\r\n```"}}
{"actor":{"display_login":"satya164"}}