mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-09 00:19:13 +08:00
Improve message
This commit is contained in:
parent
64a6cc29dc
commit
c471d07332
@ -230,7 +230,7 @@ export class MountMustBeDestructuredError extends StorybookError {
|
||||
To use the mount prop of the story context, you must configure your builder to transpile to no earlier than ES2017.
|
||||
`
|
||||
}
|
||||
More info: https://storybook.js.org/docs/writing-tests/interaction-testing#run-code-before-each-test
|
||||
More info: https://storybook.js.org/docs/writing-tests/interaction-testing#run-code-before-the-component-gets-rendered
|
||||
|
||||
Received the following play function:
|
||||
${data.playFunction}`,
|
||||
|
@ -68,13 +68,25 @@ Here's an example of using the [`mockdate`](https://github.com/boblauer/MockDate
|
||||
You *must* destructure the mount property from the context. This makes sure that storybook won't start rendering before the play function begins.
|
||||
</Callout>
|
||||
|
||||
<Callout variant="warning">
|
||||
You *must* destructure the mount property from the context.
|
||||
This makes sure that storybook won't start rendering before the play function begins.
|
||||
|
||||
This feature is not available:
|
||||
|
||||
- When you have configured a storybook framework to transpile destructure statements or async/await.
|
||||
- In Angular, as async/await is transpiled to support the zone.js polyfill.
|
||||
|
||||
Ensure that your builder is configured to transpile no earlier than ES2017.
|
||||
</Callout>
|
||||
|
||||
{/* prettier-ignore-start */}
|
||||
|
||||
<CodeSnippets path="mount-basic.md" />
|
||||
|
||||
{/* prettier-ignore-end */}
|
||||
|
||||
### Reset state in a preview loader
|
||||
### Reset state in a preview beforeEach
|
||||
|
||||
Make sure to avoid hanging state by resetting state back in a `beforeEach` function in the preview file (`.storybook/preview.js|ts`).
|
||||
This code will run before every story in the project.
|
||||
|
Loading…
x
Reference in New Issue
Block a user