tajo / ladle

🥄 Develop, test and document your React story components faster.
https://www.ladle.dev
MIT License
2.63k stars 93 forks source link

Fix StoryDecorator TypeScript error, add tests #391

Closed wojtekmaj closed 1 year ago

wojtekmaj commented 1 year ago

Broken in #388.

As per documentation, decorator gets Component as argument, and we get to render it without passing any props. We may pass props (as you do in e2e/decorators/src/args.stories.tsx), overwriting story args, but we don't have to.

However, types were suggesting otherwise, complaining that I didn't pass required props to Component.

This PR fixes that error.

changeset-bot[bot] commented 1 year ago

🦋 Changeset detected

Latest commit: c4736256585f1774df07c24b15601cfc83264346

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 12 packages | Name | Type | | ----------------- | ----- | | @ladle/react | Patch | | example | Patch | | test-addons | Patch | | test-config | Patch | | test-config-ts | Patch | | test-css | Patch | | test-decorators | Patch | | test-flow | Patch | | playwright | Patch | | test-programmatic | Patch | | test-provider | Patch | | test-swc | Patch |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
ladle ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 7, 2023 at 8:31PM (UTC)