mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-21 05:02:39 +08:00
Fix typo
This commit is contained in:
parent
afdfd04aa8
commit
12a28537bc
@ -375,7 +375,7 @@ Parameters are intended to be statically set at story load time. So setting them
|
||||
|
||||
_You can only set storySort globally_
|
||||
|
||||
If you want to change the ordering of stories, use `export parameters = { options: { storySort: ... } }` in `preview.js`.
|
||||
If you want to change the ordering of stories, use `export const parameters = { options: { storySort: ... } }` in `preview.js`.
|
||||
|
||||
### Simplified Render Context
|
||||
|
||||
|
@ -77,12 +77,10 @@ addons.setConfig({
|
||||
|
||||
### showRoots
|
||||
|
||||
Import and use `addParameters` with the `options` key in your `preview.js` file.
|
||||
Export `parameters` with the `options` key in your `preview.js` file.
|
||||
|
||||
```js
|
||||
import { addParameters } from '@storybook/react';
|
||||
|
||||
addParameters({
|
||||
export const parameters = {
|
||||
options: {
|
||||
/**
|
||||
* display the top-level grouping as a "root" in the sidebar
|
||||
@ -100,8 +98,7 @@ By default, stories are sorted in the order in which they were imported. This ca
|
||||
The most powerful method of sorting is to provide a function to `storySort`. Any custom sorting can be achieved with this method.
|
||||
|
||||
```js
|
||||
|
||||
export parameters = {
|
||||
export const parameters = {
|
||||
options: {
|
||||
storySort: (a, b) =>
|
||||
a[1].kind === b[1].kind ? 0 : a[1].id.localeCompare(b[1].id, undefined, { numeric: true }),
|
||||
|
Loading…
x
Reference in New Issue
Block a user