Skip to content

Commit 9f65c2a

Browse files
committed
re-arranging paragraphs
1 parent 6f573fb commit 9f65c2a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
Remove unnecessary statics attached to React components for different build environments
44

55
## Usage
6+
Set the statics you want via babel configuration with boolean.
7+
8+
This can be particularly useful if you want to switch certain statics on/off for certain environments. An example of this would be using something like [react-styleguide-generator-alt](https://github.com/theogravity/react-styleguide-generator-alt) for your documentation. Since that tool requires you to attach a static ```styleguide``` to your components, you probably would want to remove it in production. But you would probably want to keep it to actually build your doc server, and then remove PropTypes still. This babel plugin gives you that flexibility.
69

710
### Via `.babelrc` (Recommended)
811
Simply pass in the name of the static you want removed during build and set a boolean. If true, the static will be removed, if false, the static will stay attached to the component.
912

10-
This can be particularly useful if you want to switch certain statics on/off for certain environments. An example of this would be using something like [react-styleguide-generator-alt](https://github.com/theogravity/react-styleguide-generator-alt) for your documentation. Since that tool requires you to attach a static ```styleguide``` to your components, you probably would want to remove it in production. But you would probably want to keep it to actually build your doc server, and then remove PropTypes still. This babel plugin gives you that flexibility.
11-
1213
**.babelrc**
1314

1415
```json

0 commit comments

Comments
 (0)