Export your components
- 05 Mar 2024
- 1 Minute to read
- Print
- DarkLight
- PDF
Export your components
- Updated on 05 Mar 2024
- 1 Minute to read
- Print
- DarkLight
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
Exporting your React Native components
Your main component in a module must be exported from the index.js
file with a default export.
Plain export
It can be a plain export such as: export default YourModuleMainComponentHere;
A plain export gets converted to the following object:
{
title: "YourModuleMainComponentHere",
navigator: YourModuleMainComponentHere
}
Explicit export
You can also export an explicit object that gives you control over the title, the entry point, the redux slice, and hook:
export default {
title: "Your module title here",
navigator: YourModuleMainComponentHereOrYourMainStackNavigator,
slice: YourModuleReduxSliceHere,
hook: YourAppInitCodeHere
}
Was this article helpful?