Storybook Notes Addon for react-native
The Notes Addon allows you to write notes (text or markdown) for your stories in Storybook.
Installation
yarn add -D @storybook/addon-ondevice-notes
Configuration
Then, add following content to .storybook/main.js
:
module.exports = {
addons: ['@storybook/addon-ondevice-notes'],
};
Usage
Use the notes
parameter to add a note to stories:
export default {
title: 'My title',
component: MyComponent,
parameters: {
notes: `
# Here I can add some markdown
Put a full new line between each element.
`,
},
};
See the example app for more examples.
v6.0.1-beta.9
What's Changed
Big changes in this release.
this includes
- support for the story store changes introduced in 6.4
- compatibility with storybook v6.5
- CSF3
- HMR/Fast refresh now works properly!!!
- More code re-used from storybook core apis
- fix for a bug in the tab bar animation
Largely made possible by help from @shilman and @tmeasday on the 6.5 branch.
note: there was a temporary polyfill added to include the global document object whilst changes are made in storybook to allow for a parameterised preview and store. This shouldn't require any changes from the user and is temporary.
Breaking:
- There is now a new peer dependency on react-dom due to some code re-use around the preview.
This should hopefully be removed soon, though it shouldn't impact your development other than adding react dom to your dev dependencies. Hopefully this is an acceptable compromise for finally having 6.4/6.5 support.
commits
- update example to react native 0.70.2 by @dannyhw in https://github.com/storybookjs/react-native/pull/381
- feat: support for storybook 6.4/6.5, CSF3 and HMR fix by @dannyhw in https://github.com/storybookjs/react-native/pull/384
Full Changelog: https://github.com/storybookjs/react-native/compare/v6.0.1-beta.8...v6.0.1-beta.9