Reactjs 我需要调用页面的'componentWillMount'

Reactjs 我需要调用页面的'componentWillMount',reactjs,react-native,react-native-router-flux,Reactjs,React Native,React Native Router Flux,我正在使用“react native router flux”:“^3.38.0”。我需要调用页面的组件willmount,但是在它第一次到达那里之后,组件willmount不会被调用 版本: 请在下面查找导航代码: const RouterComponent = () => { return ( <Router sceneStyle={{ paddingTop: 65 }} navigationBarStyle={{ backgroundColor: '#81b71a'

我正在使用
“react native router flux”:“^3.38.0”
。我需要调用页面的
组件willmount
,但是在它第一次到达那里之后,
组件willmount
不会被调用

版本:

请在下面查找导航代码:

const RouterComponent = () => {
  return (
    <Router sceneStyle={{ paddingTop: 65 }} navigationBarStyle={{ backgroundColor: '#81b71a' }}>

      <Scene key='auth' initial>
        <Scene key='login' component={LoginForm} title='login here' />
      </Scene>

      <Scene key='main' >
        <Scene key='employeeCreate' component={EmployeeCreate} title='create employee' />
        <Scene
        initial
          key='employeeList'
          component={EmployeeList}
          title='Emplyees'
          rightTitle='add'
          onRight={() => Actions.employeeCreate()}
        />
        <Scene
          key='employeeEdit'
          component={EmployeeEdit}
          title='edit employee'
        />
      </Scene>
    </Router>
  );
};

export default RouterComponent;
constroutercomponent=()=>{
返回(
Actions.employeeCreate()}
/>
);
};
导出默认路由组件;

这是v3.38中的一个已知问题,在更高版本中已修复。尝试将包更新到最新版本


是最新的

您能分享您用于导航的代码吗。@DanPhilip edited4.0.0帮我解决了其他问题,我被要求返回到38您需要
组件将挂载
的确切目的是什么?也许有一个解决办法。每当显示该页面时,我都需要调用操作创建者。是的,但它不起作用,因为我只需要在页面打开时调用一次操作