Passing Parameters

React Native 6 min min read Updated: Jul 26, 2026 Beginner
Passing Parameters
Beginner Topic 7 of 15

Passing Parameters

Passing data between screens is a common requirement, such as sending a product ID from a list screen to a details screen. React Navigation handles this using route parameters.

Passing Parameters to a Screen

javascript navigation.navigate('Details', { productId: 42, name: 'Wireless Headphones' });

Reading Parameters in the Destination Screen

javascript function DetailsScreen({ route }) { const { productId, name } = route.params; return {name} (ID: {productId}); }

Setting Initial Parameters

The initialParams prop on a Stack.Screen allows defining default parameters when a screen is first loaded, before any navigation action explicitly passes values.

javascript

Updating Parameters on the Current Screen

The setParams method allows updating the parameters of the currently active screen without triggering a new navigation action.

javascript navigation.setParams({ productId: 99 });

Passing Parameters Back to a Previous Screen

To send data back from a screen to its previous screen, developers often pass a callback function as a parameter or use setParams combined with a listener on the previous screen.

Type Safety with TypeScript

When using TypeScript, defining a param list type for your navigator helps catch parameter mismatches during development rather than at runtime.

Conclusion

Passing parameters through React Navigation allows screens to communicate effectively, enabling dynamic content such as product details, user profiles, or search results to be displayed based on data passed during navigation.

Get Newsletter

Subscibe to our newsletter and we will notify you about the newest updates on Edugators