4
4
<b >Toolchain to help build React components with Primer</b >
5
5
<br ><br >
6
6
<img src =" https://img.shields.io/badge/maturity-proof--of--concept-d85151?style=flat-square " />
7
- <img src =" https://img.shields.io/github/package-json/v/primer/react-scripts ?style=flat-square " />
7
+ <img src =" https://img.shields.io/github/package-json/v/primer/react-toolchain ?style=flat-square " />
8
8
</p >
9
9
10
10
  ;
18
18
## Setup
19
19
20
20
```
21
- npm install @primer/react-scripts --save-dev
21
+ npm install @primer/react-toolchain --save-dev
22
22
```
23
23
24
24
### Storybook
@@ -40,15 +40,15 @@ Step 2. Create a `ComponentName.stories.tsx` file
40
40
We recommend putting this file next to the component.
41
41
42
42
``` jsx
43
- import {DatePicker } from ' ./date-picker'
43
+ import { DatePicker } from ' ./date-picker' ;
44
44
45
45
export default {
46
46
title: ' Common components/Datepicker'
47
- }
47
+ };
48
48
49
49
export const SimpleDatePicker = () => {
50
- return < DatePicker variant= " single" value= {new Date ()} / >
51
- }
50
+ return < DatePicker variant= " single" value= {new Date ()} / > ;
51
+ };
52
52
```
53
53
54
54
[ Learn more about stories from the Storybook docs] ( https://storybook.js.org/docs/react/get-started/whats-a-story )
@@ -57,7 +57,6 @@ export const SimpleDatePicker = () => {
57
57
58
58
You're good to go! Run ` npm run storybook ` .
59
59
60
-
61
60
<details >
62
61
<summary ><h4 >Customise storybook</h4 ></summary >
63
62
@@ -66,7 +65,7 @@ If you need to customize your storybook config, create `.storybook` directory in
66
65
1 . ` main.js `
67
66
68
67
``` js
69
- const defaultConfig = require (' @primer/react-scripts /storybook/main' );
68
+ const defaultConfig = require (' @primer/react-toolchain /storybook/main' );
70
69
const { TsconfigPathsPlugin } = require (' tsconfig-paths-webpack-plugin' );
71
70
72
71
module .exports = {
@@ -85,15 +84,17 @@ If you need to customize your storybook config, create `.storybook` directory in
85
84
```
86
85
87
86
2 . ` preview.js `
87
+
88
88
``` js
89
89
// step 1: export defaults
90
- export * from ' @primer/react-scripts /storybook/preview' ;
90
+ export * from ' @primer/react-toolchain /storybook/preview' ;
91
91
92
92
// (optional) step 2: customise and overwrite
93
- import { decorators } from ' @primer/react-scripts /storybook/preview' ;
93
+ import { decorators } from ' @primer/react-toolchain /storybook/preview' ;
94
94
import { withPerformance } from ' storybook-addon-performance' ;
95
95
96
96
decorators .push (withPerformance);
97
97
export { decorators };
98
98
```
99
- </details >
99
+
100
+ </details >
0 commit comments