This repository was archived by the owner on Oct 20, 2022. It is now read-only.

Description
Wanted to move the state of the tabs example from the Wiki up into the App.js and it does not seem to pass functions in passProps.
App.js
constructor(props) {
super(props);
this.handleTabChange = this.handleTabChange.bind(this)
this.state = { selectedTab: 'home' }
}
componentDidMount() {
const selectedTab = this.state.selectedTab
Turbolinks.startSingleScreenApp({
component: 'TabbedView',
hidesNavBar: true,
passProps: {
selectedTab: selectedTab,
onTabChange: this.handleTabChange
}
})
}
handleTabChange = (tab) => {
this.setState({ selectedTab: tab });
}
When checking the react debugger output onTabChange is never there.
Running "TabbedView" with {"rootTag":181,"initialProps":{"selectedTab":"home"}}
TabbedView.js
handleChange = (tab) => {
this.props.onTabChange(tab)
}
The above fails with
