Skip to content
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

Vuejs: the stories are executed twice #1742

Closed
miljan-aleksic opened this issue Aug 26, 2017 · 7 comments
Closed

Vuejs: the stories are executed twice #1742

miljan-aleksic opened this issue Aug 26, 2017 · 7 comments

Comments

@miljan-aleksic
Copy link

Hi, I detected my components are executed twice, at least when using Vuejs (didn't try with React). I am testing with latest 3.2.8 version. To reproduce just create a simple story like this:

<script>
export default {
  created () {
    console.log('should execute once')
  }
}
</script>

The component above should be inited once, but is done so twice. Can anyone try and confirm this issue?

@kazupon
Copy link
Member

kazupon commented Aug 26, 2017

Hi!
Thank you for your reporting!

I could not reproduce it.
Could you provide the reproduction repo please?

@miljan-aleksic
Copy link
Author

Hi @kazupon!

Nothing extra in my configuration, I used the CLI and added the created method. I did notice that this happen only on first init, so only when refreshing the browser page manually, it doesn't happen when switching to another story.

Anyway, here is the test repo https://github.com/miljan-aleksic/test-storybook. Switch to MyButton story, refresh the page and check the console.log. Tested with Chrome.

@kazupon
Copy link
Member

kazupon commented Aug 29, 2017

@miljan-aleksic
Thank you for your feedback!

I checked it. it's bug.
I'll try to fix it later.

kazupon added a commit to kazupon/storybook that referenced this issue Oct 6, 2017
kazupon added a commit that referenced this issue Oct 11, 2017
Fixed lifecycle twice executing (close #1742)
@mikemahony
Copy link

Call me crazy but this seems to have regressed? I just ran the above steps to reproduce (from the fix #1983), this time on 6.2.0-alpha.8 (next), and I'm getting call created hook twice per storybook page load...

double_created_demo.mov

@jowilhnson
Copy link

Changing props via the Controls add-on seems to be triggering multiple updates as well.

@mikemahony
Copy link

Hi @kazupon and @miljan-aleksic, would you please consider re-opening this issue for us? Thank you in advance!

@bl-nkd-v
Copy link

Bumping this, seeing the same behavior in 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants