【发布时间】:2017-11-29 12:25:48
【问题描述】:
我有一个带有自定义导航栏的场景
<Scene
navBar={CustomNavBar}
component={MComponent}
/>
MyCOmponent 有一个名为 _hello() 的方法
export default class MComponentextends PureComponent {
constructor(props) {
super(props);
}
_hello = () => {
console.warn('HELLO WORLD')
}
是否可以在我的导航栏组件中调用 MyComponent _hello() 方法?
export default class CustomNavBar extends Component {
constructor(props) {
super(props);
this.state = {
};
this.props._hello () // does not work
}
}
【问题讨论】:
标签: reactjs react-native react-native-router-flux