I pass some parameters to the screen using expo-routing but the screen is a class-defined component, how can I get params?
When I log props I have this: {"segment": "home/index"}
screen #1
router.replace({ pathname: 'home', params: { id: '123' } });
screen #2
export default class HomePage extends React.Component<HomePagePropsType, HomePageStateType> {
constructor( props: HomePagePropsType ) {
super( props );
console.log( this.props )
}
This is because you need to use
useLocalSearchParams
fromexpo-router
Try this instead: