How to Write a Story Book

Writing a story book

The storybook is about writing stories. Normally a story contains a single state of one of your components. It's like a visual test case. Auteur James Patterson sur la façon d'écrire une histoire imparable. Have you got what it takes to take up the challenge of "Write the Story"?

The storybook is about storytelling.

The purpose of the storyline book is to create tales. Normally a history contains a state of one of your component. From a technical point of view, a storyline is a feature that gives back a reactlement. There are a number of tales you can create for your component and you will receive a fairy tale book. But to keep tales near your com-ponents is a good notion.

Suppose your UI compo-nents are in a folder named src/components. You can then post your story in the src/stories folder. At any time you can modify your story book configuration files and prompt them to download story from anywhere.: import REACH from'react'; impor { storysOf } from'@storybook/react'; impor { to {s {s {s {s } from'@storybook/addon-actions'; importer button from'.../components/Button'; )); this will display story in your storybook:

It is only our key story writer interface. You can also use the offical and third-party storybook add-ons to get more features. Sometimes you will want to download your story in a dynamic way instead of using it in the storybook configuration files. React NiceLabel React Adapter dissolves all import at compile speed, so it is not possible to download the module on-the-fly.

When you don't want to export all your storylines by hand, you can use the react-native-storybook-loader to automate the imports for all your storylines. An upholsterer is a way to pack a tale with a shared collection of components. Let's say you want to put all your tales in the spotlight.

The fairytale book 3. 3, you can use marksdown in the story book by defaults. You only need to do this if you want to have a transcript and it will be saved in an HTML template for you.

Then you can use this in any add-on that support HTML (e.g. notes). x imports from Rect from'react'; imports from {storiesOf } from'@storybook/react'; imports from { mitNotes } from'@storybook/addon-notes'; imports from MyComponent from '.

Several story books for different types of story (or components) can be executed.

You can also build different NPM scenarios to run different histories. "starting story book -p 8001 -c.storybook app"

Auch interessant

Mehr zum Thema