csf icon indicating copy to clipboard operation
csf copied to clipboard

Add toString to fix bug in storybook

Open matthew-gerstman opened this issue 2 years ago • 3 comments

Storybook seems to be passing integers to sanitize causing it to crash the application. I've tested that adding toString prevents it from breaking.

matthew-gerstman avatar Jan 19 '22 16:01 matthew-gerstman

FYI this happens whenever calling a function called add with a numeric literal passed to it inside of my applicattion source code

matthew-gerstman avatar Jan 19 '22 16:01 matthew-gerstman

Hey @matthew-gerstman

I faced the same issue and explained it in details here: https://github.com/storybookjs/storybook/pull/18930#issue-1338144975

zhyd1997 avatar Aug 15 '22 23:08 zhyd1997

And I think white list (only accept string type) is better than black list (accept other types, eg. number and Object, and do some additional operations and then return string value) here.

zhyd1997 avatar Aug 15 '22 23:08 zhyd1997