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.
This is a question regarding the behavior of
undefinedstory 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
undefinedas 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.tsxfile.