nytimes / react-tracking

🎯 Declarative tracking for React apps.

Home Page:https://open.nytimes.com/introducing-react-tracking-declarative-tracking-for-react-apps-2c76706bb79a

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Play nice with Storybook

thany opened this issue · comments

Using react-tracking in Storybook causes issues, when also using addon-knobs.

I've been able to boil it down to the track() decorator that appears to do something that messes things up. When I remove that, it works great, but without tracking.

Please refer to this issue: https://github.com/storybookjs/storybook/issues/13011

I'm creating this issue here, simply to create awareness of this from your end.

Thanks for raising this, @thany -- I'm not sure I quite understand the issue or what we can do differently in react-tracking to help. Any ideas?

I don't really know what's happening in the background. Something appears to be happening, something is added or changed on a decorated component that the Story component from Storybook doesn't really like. But what exactly? I was hoping, if you have the time of course, you might be willing to collab with the Storybook guys to figure it out.

Do you notice this on both class-based and function-based components? I took a quick look and I noticed that neither your withTracking and their withKnobs wrappers hoist-non-react-statics as we do in react-tracking -- I'm not sure if that might be affecting things?