storybookjs / addon-knobs

Storybook addon prop editor component
MIT License
12 stars 17 forks source link

escapeHTML option isn't respected in v6 with storiesOf #18

Open tay1orjones opened 4 years ago

tay1orjones commented 4 years ago

Describe the bug Since updating to v6, my stories using the storiesOf api that configure the escapeHTML addon-knobs option present an error.

Config at the story level:

{
  knobs: {
    escapeHTML: false, // needed for greater than less than
  },
}

Error I see that relates to invalid props being passed on storyshot generation due to being HTML escaped:

Failed: "Warning: Failed prop type: Invalid prop `comparison` of value `&lt;` supplied to `Threshold`, expected one of [\"<\",\">\",\"=\",\"<=\",\">=\"].

I know I can migrate these stories to CSF and it will probably fix it, but it's my understanding that storiesOf is intended to be supported for the time being.

shilman commented 4 years ago

If this is a problem (haven't confirmed), it's a regression in addon-knobs and unrelated to storiesOf vs CSF (which are almost entirely isomorphic -- CSF executes storiesOf API under the hood)

FYI, we’ve released addon-controls in Storybook 6.0. Controls are portable, auto-generated knobs that are intended to replace addon-knobs long term. (Note: escapeHtml is not yet supported in controls https://github.com/storybookjs/storybook/issues/12516)

Please upgrade and try them out today!

stale[bot] commented 3 years ago

Hi everyone! Seems like there hasn't been much going on in this issue lately. If there are still questions, comments, or bugs, please feel free to continue the discussion. Unfortunately, we don't have time to get to every issue. We are always open to contributions so please send us a pull request if you would like to help. Inactive issues will be closed after 30 days. Thanks!