-
-
Notifications
You must be signed in to change notification settings - Fork 154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
storybook ignores my decorators #383
Comments
On the beta please avoid using storiesOf where possible and use CSF. I'm not sure but I think it might be related to that. Ideally of course storiesof will work but I would try to avoid adding new stories with the old syntax anyway since its deprecated. |
Also can you try v6.0.1-beta.8? |
@Michael-Ivlev after adding them did you run pod install? looks like its missing on the native side. Also react-navigation shouldn't be needed for storybook |
I rebuild the app in nx it working on v6.0.1-beta.7 and v6.0.1-beta.5 without this error, but still without decorators |
@Michael-Ivlev Can you provide a reproduction of the issue so I can debug it? There shouldn't be any issue with decorators not being applied. |
Reproduction steps:
a guide that can help: https://blog.nrwl.io/use-storybook-with-nx-react-native-2ddd8c010eda |
@Michael-Ivlev thanks for providing the steps, however if you could provide a repository with those already completed it would be easier for me. I'll try to look during the weekend. Also the error in the screenshot here is solved by running pod install. |
After some work, I've found that some dependencies were on older versions, so I updated them and now addDecorator inside the story works, but not in the global decorator. I've tried to use CFS but without success. This is my project: |
@Michael-Ivlev in v6.0.1-beta.7 you need to use preview.js and not .jsx however it was changed in v6.0.1-beta.8 so that might be why |
updated the version to v6.0.1-beta.8 without any result in global theme provider, and CSF components do not render. |
@Michael-Ivlev hey sorry been super busy, will try to look at this soon might end up being on the weekend. Thanks for the detailed information 👍 . |
I'm having the same issue as @Michael-Ivlev, I just created a new project from scratch and it fails with the same problems, first it doesn't find the
This is the Nx packages used:
Project dependencies:
|
@mtzfactory please make sure you run pod install Still need to check this, sorry for the delay |
I've just checked the latest version and as long as you properly install the dependencies (Pods and npm) there shouldn't be any issue with 6.0.1-beta.8. If your NX setup is not installing pods then thats something that needs to be resolved. FYI |
regarding decorators I'll look at that next |
To use CSF with NX and React Native you should use not yet released version of package.json:
After updating your Then in your your app change `storybook.ts' to use modules instead of loadStories:
edit: this doesn't solve the decorator issue. Global decorators are not loaded even when the stories are in CSF. |
Im not sure about this unreleased loader thing, in the v6 beta there is a built in story loader so it would surely make mor sense to use that? |
Please try the latest version of the beta, a lot has been updated. |
I tested beta.6 and with some tinkering I was able to get most of it working. One issue was that Anyway there are some work to be done in NX to support new v6 rn storybook though. Current version is not using generated |
@diginikkari Yes in my point of view NX needs to change to use the new built in loading. Not only that but storiesOf is deprecated and should be avoided. Decorators are likely not working specifically for that reason since they aren't following the intended usage. Also now the latest beta is 6.0.1-beta.9. I will look into the core-common stuff you mentioned. |
#391 should resolve the main.ts thing |
seems like a very old issue let me know we need to reopen |
Describe the bug
So I tried to give a styled component theme provider for all my storybooks, but somehow storybook ignores my decorators. if I warp my story with the theme provider everything works. I use react-native v0.70.1 with NX and storybook/react-native v6.0.1-beta.5
To Reproduce
Add a decorator to your storybook
Expected behavior
The Story should get a theme provider
Code snippets
The text was updated successfully, but these errors were encountered: