reactjs - I cannot call my action creator at onRight -
i using "react-native-router-flux": "^3.38.0"
. need call action creator @ onright
. after using connect
shows me this.props
undefined
, why?
import react 'react'; import { router, scene, actions } 'react-native-router-flux'; import { connect } 'react-redux'; import loginform './components/loginform'; import employeelist './components/employeelist'; import employeeedit './components/employeeedit'; import employeecreate './components/employeecreate'; import { employeeformreset } './actions'; const routercomponent = () => { return ( <router> <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={() => { this.props.employeeformreset(); return actions.employeecreate(); } } /> <scene key='employeeedit' component={employeeedit} title='edit employee' /> </scene> </router> ); }; export default connect(null, { employeeformreset })(routercomponent);
i made class base component , worked !!
Comments
Post a Comment