I'm using react-navigation v6 in my React Native app, and in this section on passing params to screens, it shows that you can get itemId
and otherParam
from route.params
and set their values such that you can use itemId
and otherParam
throughout the component.
function DetailsScreen({ route, navigation }) {
/* 2. Get the param */
const { itemId, otherParam } = route.params;
What I Want To Know: If I'm using a class component instead of a functional one, where can I set itemId
and otherParam
? As in, is there a place in a class component where I could run const { itemId, otherParam } = this.props.route.params;
?