I am trying to send a RouteKey
prop and then trying to use the prop inside a chained function.
Here is my Component:
<MenuItem RouterKey={'assetsList'} />
And inside the component definition, I am trying to use it inside the actions function like so :
import { Actions } from 'react-native-router-flux';
const MenuItem = (props) => {
return (
<TouchableWithoutFeedback onPress={() => { return `${Actions}.${props.RouterKey}()`; }}>
<View>
//somethings here...
</View>
</TouchableWithoutFeedback>
);
};
Basically what I want to do is:
<TouchableWithoutFeedback onPress={() => { Actions.whateverWasPassed(); }}>
However, I am not able to do this. What am I missing here? I know the way I am doing it is wrong. What is the correct way to do this?