rsnext/examples/with-storybook/.storybook/preview.js
Rafael Almeida 521cc621d8
Update Storybook examples to v6.0 (#16139)
* Update with-storybook example

* Delete with-storybook-typescript example

* Add TypeScript section to the README

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-08-15 15:42:17 -05:00

16 lines
422 B
JavaScript

export const parameters = {
options: {
storySort: (a, b) => {
// We want the Welcome story at the top
if (b[1].kind === 'Welcome') {
return 1
}
// Sort the other stories by ID
// https://github.com/storybookjs/storybook/issues/548#issuecomment-530305279
return a[1].kind === b[1].kind
? 0
: a[1].id.localeCompare(b[1].id, { numeric: true })
},
},
}