Export your components
  • 05 Mar 2024
  • 1 Minute to read
  • Dark
    Light
  • PDF

Export your components

  • Dark
    Light
  • PDF

Article summary

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?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.