-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Action logger breaks stateful components #116
Comments
I can see what's going on here. We should not render in that case. Note: |
That sounds good! The re-render also causes assets like images to flash every time an action is taken as the whole story gets re-rendered. |
Actually, I find out a simple way to fix this. We can check for equality of both |
Guys, now we've a fix for this with PR #126. |
I'm not sure if I'm doing anything wrong (just picked up storybook, loving it). But it seems like I still get this error if I'm passing the event object from a form submit, rather than a click. More specifically the Storage quote error. Any ideas? I'm assuming that React is sending a different event type that isn't handled. Edit: Doing some additional testing, it is because I was proxying the default submit event listener and sending the form data as the first parameter to the passed action, and the event as the second i.e.
This causes the system to hang. |
This update seems to have fixed my original issue above. Thanks. |
@willdady great. |
Note: @de-monkeyz mentioned issue fixed by his PR: #132 |
I came here confused as to how to exec JS in the actions call. I'd rather just call a function on the component that sends data to the action logger. <ColorPicker onChange={action('state changed', this.state.colorValue)} /> |
handleEntry: () => action('entry-change') |
I've just started using storybook and so far it's been great. I've ran into the following issue. Basically if I have a component which maintains it's own internal state the action logger causes the component to be re-rendered when called, effectively creating the component anew.
The following breaks the component by re-rendering the component...
...but the following does not.
Is this the expected behaviour? Should calling action() really cause a re-render?
The text was updated successfully, but these errors were encountered: