Callback props #1634
-
Hello! I've started using React Cosmos on a project, and I'm curious what the typical way of handling callback props, such as In my mind, it'd be nice to have a pane that's an event log or something, and then pass in a callback that writes even event to that log. So, the fixture would be something like:
I had a look around in the docs, and the only example I could find was using Assuming that something like this doesn't already exist, would it make more sense just to build it as an ordinary React component and use from within the fixture, or to write it as a plugin? The advantage of the latter is presumably that the event log could be rendered as part of the React Cosmos UI proper? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @mwilliamson, There's no specific functionality in Cosmos for handling callback events. I generally just log stuff in the browser console. You could build something generic that can be reused across fixtures in two ways:
Let me know if you have other questions and if you create something for yourself do share with us :). |
Beta Was this translation helpful? Give feedback.
Hi @mwilliamson,
There's no specific functionality in Cosmos for handling callback events. I generally just log stuff in the browser console.
You could build something generic that can be reused across fixtures in two ways:
Let me know if you have ot…