Skip to content
This repository was archived by the owner on Jan 31, 2024. It is now read-only.

Commit ff0f386

Browse files
committed
add disclaimer regarding Storybook 7 [skip ci]
1 parent b0d25ad commit ff0f386

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

+20
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,26 @@
66

77
<br/>
88

9+
## ⚠️ Attention!
10+
11+
If you're using Storybook 7, you need to read this section. Otherwise, feel free to skip it.
12+
13+
`@storybook/testing-react` has been promoted to a first-class Storybook functionality. This means that **you no longer need this package**. Instead, you can import the same utilities, but from the `@storybook/react` package. Additionally, the internals of `composeStories` and `composeStory` have been revamped, so the way a story is composed is more accurate. The `@storybook/testing-react` package will be deprecated, so we recommend you to migrate.
14+
15+
Please do the following:
16+
17+
1. Uninstall this package
18+
2. Update your imports
19+
20+
```diff
21+
- import { composeStories } from '@storybook/testing-react';
22+
+ import { composeStories } from '@storybook/react';
23+
24+
// OR
25+
- import { setProjectAnnotations } from '@storybook/testing-react';
26+
+ import { setProjectAnnotations } from '@storybook/react';
27+
```
28+
929
## The problem
1030

1131
You are using [Storybook](https://storybook.js.org/) for your components and writing tests for them with [jest](https://jestjs.io/), most likely alongside [Enzyme](https://enzymejs.github.io/enzyme/) or [React testing library](https://testing-library.com/). In your Storybook stories, you already defined the scenarios of your components. You also set up the necessary decorators (theming, routing, state management, etc.) to make them all render correctly. When you're writing tests, you also end up defining scenarios of your components, as well as setting up the necessary decorators. By doing the same thing twice, you feel like you're spending too much effort, making writing and maintaining stories/tests become less like fun and more like a burden.

0 commit comments

Comments
 (0)