You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For a visualization graph I am passing a d3 graph structure with cycles.
Storybook complains that it cannot deal with a prop with cycles.
Yes, it's easy enough to work around that issue by wrapping the graph in a function prop that returns it, but it feels awkward to change the component signature to accommodate storybook.
Wouldn't it be important for Storybook to support any kind of props?
The text was updated successfully, but these errors were encountered:
Storybook communicates between your component preview and the "manager" (UI and addons surrounding the components) using postMessage. That method doesn't allow JS objects to be sent, so your props need to be stringified before being sent and JSON.stringify doesn't support cycles.
Thanks for the info @phated. Perhaps, since it can accept functions, it might be able to transparently wrap/unwrap props with cycles into functions to circumvent that limitation.
@bebbi Hmmm, I was just looking at the function caveats in https://github.com/storybookjs/telejson and the behavior seems a bit different than what you'd expect with cycles (specifically the lazy eval and performance implications). 🤔
For a visualization graph I am passing a d3 graph structure with cycles.
Storybook complains that it cannot deal with a prop with cycles.
Yes, it's easy enough to work around that issue by wrapping the graph in a function prop that returns it, but it feels awkward to change the component signature to accommodate storybook.
Wouldn't it be important for Storybook to support any kind of props?
The text was updated successfully, but these errors were encountered: