Reactotron / Storybook set up guide #25297
Unanswered
hristo87
asked this question in
Show and tell
Replies: 3 comments
-
Thanks for providing this guide :) |
Beta Was this translation helpful? Give feedback.
0 replies
-
Man this is amazing ! |
Beta Was this translation helpful? Give feedback.
0 replies
-
dang finaly i found how to but.. something wrong with switcher =( |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
After thorough research, I could not find any good guide or explanation on how to make Reactotron work in conjunction with Storybook. Although the documentation is good, I still faced challenges making it run by following the provided instructions. Since I spent a decent amount of time trying to figure it out, I have finally succeeded and decided to share the solution with everyone who might need it in the future. As a prerequisite you need react native storybook installed and configured. So, let's get started:
First you need to properly configure Reactotron as described in the documentation with a bit of a twist:
As a second step, you need to import the config in the App.ts or index.js file, again as described in the documentation. However, here comes the tricky part. When using Hermes, it's essential to ensure that the Reactotron configuration is loaded synchronously. The import('./ReactotronConfig') statement might not be evaluated synchronously, leading to console.tron being undefined at the time it's accessed. So, here's how I fixed it (there is probably a more optimal way):
Here is the whole component:
Beta Was this translation helpful? Give feedback.
All reactions