Is your feature request related to a problem? Please describe.
What happened a bunch of time to me is
- I had a working stories for some component
- I updated the component by adding new required prop - without it the component crashes
- I forget to update the stories
- Since the stories use the controls
Story<Props> type + .args pattern (that is AFAIK the recommended way to do it in the docs) the story crashes
We do have tsc + eslint + ladle build in our CI pipeline and none of these catches that the story is no longer working
Describe the solution you'd like
2 solutions come to my mind
- have some new command (like
ladle verify) that would actually render all of the stories and report if some of them render error?
- change something with how the story is defined or its types, so that this would get caught on type level?
Additional context
component
export type TestComponentProps = {
requiredA: () => number;
requiredB: () => number;
};
export const TestComponent = ({ requiredA, requiredB }: TestComponentProps) => {
return <h1>a+b = {requiredA() + requiredB()}</h1>;
};
story
export const Test: Story<TestComponentProps> = (props) => <TestComponent {...props} />;
Test.args = {
requiredA: () => 1,
// requiredB: () => 2,
// ^ if this one is missing, tsc/linter/build passes but the story crashes when rendered
};
Is your feature request related to a problem? Please describe.
What happened a bunch of time to me is
Story<Props>type +.argspattern (that is AFAIK the recommended way to do it in the docs) the story crashesWe do have
tsc+eslint+ladle buildin our CI pipeline and none of these catches that the story is no longer workingDescribe the solution you'd like
2 solutions come to my mind
ladle verify) that would actually render all of the stories and report if some of them render error?Additional context
component
story