Reputation: 41
I have successfully passed react native navigation parameters as follows:
PageOne = ({ navigation, route }) => {
const { itemId, otherParam } = route.params;
...
}
And I have done passing redux props to use redux actions as follows:
PageTwo = (props) => {
}
How can I put the parameters and the props together into a component?
Your help will be highly appreciated!
Upvotes: 0
Views: 344
Reputation: 1019
you can combine them like:
PageOne = ({ navigation, route, reduxParam1,reduxParam2 }) => {
const { itemId, otherParam } = route.params;
}
or you can use like this too
PageOne = (props) => {
const { itemId, otherParam } = props.route.params;
}
Upvotes: 1
Reputation: 1397
this should work
Page = (props) => {
const { navigation, route } = props
const { itemId, otherParam } = route.params;
...
}
Upvotes: 1