Skip to content
Advertisement

Avoid repeating params in stack navigation

I am building the auth part of the stack navigation for a react navigation app, and ended with something like thiss:

JavaScript

Is there any way I can avoid adding the url initialParams everywhere and add it maybe to the stack group screen around?

I tried to add it in the screenOptions prop in the stack group around, but didn’t work.

Do you guys have any suggestion?

Thanks!

Advertisement

Answer

You can create an object and use spread operator on components.

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement