C
C
Ceretean2019-06-28 11:34:26
React
Ceretean, 2019-06-28 11:34:26

How to pass props from a component to a router?

I have a router with all navigation, in which I connect a custom header, and the question is, I have a page with a component in which, for example, values ​​from the editor arrive, I need to transfer them to the router and transfer them from the router to the header, is this possible? if so how?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
Ceretean, 2019-06-28
@Ceretean

I decided that the following construction helped in the router
const Home = createStackNavigator(
{
Home: {
screen: HomeScreen,
navigationOptions: ({ navigation }) => {
return {
title: navigation.getParam('title'),
};
},
},
} )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question