Skip to content

Commit

Permalink
Merge pull request #5629 from nitaking/fix-addon-ondevice-knobs-readme
Browse files Browse the repository at this point in the history
Fix unkind addon-ondevice-knobs readme.
  • Loading branch information
shilman committed Feb 20, 2019
1 parent 588de42 commit 705599b
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions addons/ondevice-knobs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@ This is how Knobs look like:
**This addon is a wrapper for addon [@storybook/addon-knobs](https://github.com/storybooks/storybook/blob/master/addons/knobs).
Refer to its documentation to understand how to use knobs**


## Getting Started

First of all, you need to install knobs into your project.

```sh
npm install @storybook/addon-ondevice-knobs
yarn add @storybook/addon-ondevice-knobs @storybook/addon-knobs --dev
```

Then create a file called `rn-addons.js` in your storybook config.
Expand All @@ -27,8 +26,10 @@ Then create a file called `rn-addons.js` in your storybook config.
import '@storybook/addon-ondevice-knobs/register';
```

> `@storybook/addon-ondevice-knobs` use register only.
Then import `rn-addons.js` next to your `getStorybookUI` call.

```js
import './rn-addons';
```
Expand All @@ -38,3 +39,10 @@ Now, write your stories with knobs.
**Refer to [@storybook/addon-knobs](https://github.com/storybooks/storybook/blob/master/addons/knobs) to learn how to write stories.**

**Note:** you'll still have to install `@storybook/addon-knobs` as well and import `withKnobs` and all knob types _(e.g. `select`, `text` etc)_ from that module.

```js
// Example
import { withKnobs, text, boolean, number } from '@storybook/addon-knobs';

// Write your story...
```

0 comments on commit 705599b

Please sign in to comment.