bbbtech / storybook-formik

A storybook decorator that allows you to use components in your stories that rely on Formik context.
53 stars 17 forks source link

BUG: With control example does not work on Docs #51

Open VladimirAfanasievFS opened 2 years ago

VladimirAfanasievFS commented 2 years ago

when use @storybook/addon-essentials docs page has loop update I have added consol.log("loop") to show the problem

loop image

bhishp commented 2 years ago

Interesting, thanks for raising this issue. I am away for a few weeks now with limited internet access so I can't investigate in detail, but if anyone gets an opportunity to do some deeper digging or raise a PR, I should be able to get it merged/deployed.

I notice that this code block was added in the following PR: https://github.com/bhishp/storybook-formik/pull/38/files#diff-0b5adbfe7b36e4ae2f479291e20152e33e940f7f265162d77f40f6bdb5da7405R51, in order to support controls, @jlaramie you able to take a look back over your change?

solace commented 2 years ago

I have observed this issue as well and a workaround is to use inlineStories: false for docs.

eg.

  parameters: {
    docs: {
      inlineStories: false,
      iframeHeight: 300,
    },
  },

Note that there are drawbacks to this rendering method: https://storybook.js.org/docs/react/writing-docs/docs-page#inline-stories-vs-iframe-stories

jlaramie commented 2 years ago

I will see about looking over this. Just saw this on my side.

diego-oikos commented 1 year ago

The same situation is happening in my codebase. I did a test and, if I use a <Formik> component instead of using the withFormik hook, the loop disappears. Also tried @solace 's workaround, and the loop stops happening. Please let me know if I can help further.

sergei-maertens commented 1 year ago

Is there any progress on this issue? Can we help in some way? I've just noticed this was crashing my browser too. The inlineStories: false workaround works, but I'd prefer to get to the root cause for this.

bhishp commented 1 year ago

Is there any progress on this issue? Can we help in some way? I've just noticed this was crashing my browser too. The inlineStories: false workaround works, but I'd prefer to get to the root cause for this.

I'm afraid that I don't have a lot of time to maintain this project right now, but happy to accept PRs. As mentioned above, there seemed to be a previous PR that may be related here