2

I understand we can create and test React Native Components in isolation in Storybook. But how do we export/publish the components to integrate in our app?

In React -

  1. I used react-docgen that will allow me to create and document components as a standalone project
  2. Then I will build and publish my doc app as a package to npm registry and npm install as dependency in my app to import those components

How do we do same in Storybook with React Native? Should I -

  1. copy files/code of tested components in my actual app?
  2. export everything just in stories folder and build and publish as package and install as dependency in my app?
  3. Install storybook in my actual app? But I guess that's not an option as storybook is supposed to be run as standalone app in itself

May be I am missing something obvious as no tutorial/article/doc talk about how to consume the created Components in final apps? Can someone please shed some light? Thank you.

mustafa1993
  • 541
  • 1
  • 5
  • 17

1 Answers1

0

Ok, someone finally said this in a tutorial-

Once you find the component and the state that you want, you can see the source code you need to place in your application to get the exact same functionality

So, after all it will act simply like a UI library documentation from where you need to copy code from example and cannot add stories as dependency to your project.

mustafa1993
  • 541
  • 1
  • 5
  • 17