nandorojo / solito

🧍‍♂️ React Native + Next.js, unified.
https://solito.dev
MIT License
3.54k stars 180 forks source link

Storybook.js Support #49

Closed jalexw closed 1 year ago

jalexw commented 2 years ago

I am hoping to use Storybook.js to build a component library for a Solito app I am building. Has anyone tried to install Storybook.js into a Solito project with success? The Storybook.js CLI currently does not have Solito as an installation option and I am unsure of whether it is best to manually set up Storybook.js stories in the apps/next, apps/expo or packages/app folders.

Would love to hear your thoughts on creating a Solito preset in the Storybook.js CLI or your experience installing it in an existing Solito app!

nandorojo commented 2 years ago

I know @axeldelafosse has an example repo with storybook/expo/next

axeldelafosse commented 2 years ago

Yeah! Here it is: https://github.com/axeldelafosse/storybook-rnw-monorepo

dohomi commented 1 year ago

The example seems to be outdated because without any additional steps Storybook breaks due to missing router context.

Uncaught Error: NextRouter was not mounted.

To fix this storybook-addon-next-router comes to a rescue

nandorojo commented 1 year ago

You’ll need to upgrade to the latest version of solito

dohomi commented 1 year ago

Even with 2.1.3 I need to add storybook-addon-next-router into my Storybook environment.