For the return type, use ReactElement instead of JSX.Element. However, if the function is already typed, such as via StoryObj.render, then we don't need to provide an explicit return type:
When writing descriptions, manually break lines at sentences or clauses, not at arbitrary fixed column like 80 or 100:
// Before
`
This is a sentence. This is
another sentence, with 2 clauses.
`
// After
/**
* This is a sentence.
* This is another sentence,
* with 2 clauses.
*/
In meta, use docsMetaParameters instead of Utils.page.component:
// Before
const meta = {}
Utils.page.component(meta, {
shots
})
// After
const meta = {
parameters: docsMetaParameters({
gallery
})
}
In meta, use docsMetaArgTypes instead of Utils.arg:
At the
develop
branch, the Button component is migrated as an example. Let's migrate the rest of them.Use the guide below to migrate them.
Migration Guide
StoryObj
) instead of function (StoryFn
):ReactElement
instead ofJSX.Element
. However, if the function is already typed, such as viaStoryObj.render
, then we don't need to provide an explicit return type:Utils.story
. Remember to unescape the grave accent ("`") character:docsMetaParameters
instead ofUtils.page.component
:docsMetaArgTypes
instead ofUtils.arg
: