Enable strict mode in storybook on a per story basis#3333
Conversation
| <Checkbox | ||
| marginTop={10} | ||
| isSelected={selected} | ||
| onChange={() => setSelected(selected => !selected)}> | ||
| Toggle strict mode | ||
| </Checkbox> |
There was a problem hiding this comment.
TODO: still trying to figure out if it is possible to have this be a option in the controls panel instead
There was a problem hiding this comment.
Can't put it there, but you could put it up in the toolbar across the top of the stories, where we put the locale/scale/theme
There was a problem hiding this comment.
urgh, I was hoping that https://storybook.js.org/docs/react/essentials/controls#parameters was alluding to being able to set a control param globally but putting it in the toolbar sounds good as well
There was a problem hiding this comment.
you probably could through a decorator but I think it'd be a lot more work than it's worth, plus you'd have to apply it to every component, there's a number of them with no controls
I think toolbar is the better solution
|
Build successful! 🎉 |
|
Build successful! 🎉 |
the globals are updating anymore for some reason...
| let updateStrict = (val) => { | ||
| setStrict(val); | ||
| }; | ||
| channel.on('strict/updated', updateStrict); |
There was a problem hiding this comment.
I would've like to used the storybook globals but for some reason it stopped working
snowystinger
left a comment
There was a problem hiding this comment.
Well, the storybook seems to be running just fine. This is somewhat problematic for me though, since I can't seem to do anything that gives a StrictMode error. Have you been able to see any?
|
A good candidate is ComboBox (or anything that uses a overlay I believe). |
o, I figured it out, can't test it in storybook built by CI, that's production.... haha, have to do it locally |
snowystinger
left a comment
There was a problem hiding this comment.
Great, I can see NumberField not working when strict mode is on and it works when strict mode is off.
Closes
✅ Pull Request Checklist:
📝 Test Instructions:
🧢 Your Project: