sm-react / storybook-chapters Goto Github PK
View Code? Open in Web Editor NEWReact Storybook Addon for Hierarchical Substories (Chapters)
Home Page: https://sm-react.github.io/storybook-chapters
License: MIT License
React Storybook Addon for Hierarchical Substories (Chapters)
Home Page: https://sm-react.github.io/storybook-chapters
License: MIT License
I use @storybook/react-native for a React Native project, and I did not install @storybook/react.
After install and run storybook-chapters, it shows:
error: bundling: UnableToResolveError: Unable to resolve module `@storybook/react` from `{path_to_project}/node_modules/@storybook/addon-chapters/dist/index.js`:
Module does not exist in the module map or in these directories:
{path_to_project}/node_modules/@storybook/addon-chapters/node_modules/@storybook
, {path_to_project}/node_modules/@storybook
Do I need to install @storybook/react? Does it support React Native app development?
Running into type error when @storybook/[email protected]
tries to register @storybook/[email protected]
here: https://github.com/sm-react/storybook-chapters/blob/master/register_es6.js#L11
After following the guideline in the README file, I added a line to addons.js
:
import '@storybook/addon-chapters/register';
but when I ran storybook, it shows:
ERROR in ./storybook/addons.js
Module not found: Error: Can't resolve '@storybook/addon-chapters/register' in '{path_to_project}/storybook'
@ ./storybook/addons.js 1:0-45
@ multi ./storybook/addons.js ./~/@storybook/react-native/dist/manager/index.js
I check this repo and I find the register.js
file in the ./dist/register.js
not ./register.js
.
In your readme you've documented this as the API for adding chapters:
// stories.js:
storiesOf('React App', module)
.chapter('Left panel')
.add('Button 1', fn(1))
.add('Button 2', fn(2))
.chapter('Bottom Panel')
.add('Input 3', fn(3))
.add('Input 4', fn(4))
.endOfChapter()
.chapter('Header Panel')
.add('Input 5', fn(5))
.add('Input 6', fn(6))
.endOfChapter()
.endOfChapter()
.chapter('Right panel')
.add('Button 7', fn(7))
.add('Button 8', fn(8))
.endOfChapter()
I wonder how much effort it would take to change this into:
// stories.js:
storiesOf('React App', module)
.chapter('Left panel', chapter => chapter
.add('Button 1', fn(1))
.add('Button 2', fn(2))
.chapter('Bottom Panel', chapter => chapter
.add('Input 3', fn(3))
.add('Input 4', fn(4))
)
)
.chapter('Header Panel', chapter => chapter
.add('Input 5', fn(5))
.add('Input 6', fn(6))
)
.chapter('Right panel' chapter => chapter
.add('Button 7', fn(7))
.add('Button 8', fn(8))
)
No more need for .endOfChapter()
and code indenting-wise it's more correct.
Actual behaviour:
Given I opened a story
When I refresh the page
Then I am at the root of the storybook
Expected behaviour:
Given I opened a story
When I refresh the page
Then the story is still open
since v0.5.0 it's @storybook/addon-chapters
on npm
ัั @hadfieldn
I have an error when I add the line 'import '@storybook/addon-chapters' in my config.
Uncaught Error: Accessing nonexistent addons channel, see https://storybook.js.org/basics/faq/#why-is-there-no-addons-channel
at AddonStore.getChannel (index.js:39)
at setupChannel (store.js:297)
Is this a bug or am I setting something wrong?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.