You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is a question regarding the behavior of undefined story parameters and how they're supposed to work, because I only found this out from looking at old PRs. Seems this is not in the docs (or I was too blind to see it?).
Whenever you have undefined as a possible value for a parameter, it will always be cast into a string. So if you want to do any conditional rendering, you can't check for truth/boolean value, but you need to explicitly compare it as a string.
From what I understand, this is expected/wanted functionality, right?
This is a question regarding the behavior of
undefined
story parameters and how they're supposed to work, because I only found this out from looking at old PRs. Seems this is not in the docs (or I was too blind to see it?).Whenever you have
undefined
as a possible value for a parameter, it will always be cast into a string. So if you want to do any conditional rendering, you can't check for truth/boolean value, but you need to explicitly compare it as a string.From what I understand, this is expected/wanted functionality, right?
I've created an example here: https://stackblitz.com/edit/ladle-m2rhbuxm?file=src%2Fcontrols.stories.tsx
Please look at the
controls.stories.tsx
file.The text was updated successfully, but these errors were encountered: