Skip to content

Commit ce2387f

Browse files
oliviertassinaridevelopit
authored andcommitted
Update README.md (#10)
* Update README.md Suggest using `babel-plugin-transform-react-remove-prop-types` with React like API * Update README.md
1 parent 820f85b commit ce2387f

File tree

1 file changed

+26
-3
lines changed

1 file changed

+26
-3
lines changed

README.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This is literally copied from the React 0.14 codebase.
77
If you're using PropTypes with React, it would be silly to reference this standalone version.
88

99

10-
### Usage
10+
## Usage
1111

1212
```js
1313
function check(props, propTypes) {
@@ -34,7 +34,9 @@ let valid = check({
3434
valid; // true
3535
```
3636

37-
### Disabling in production build
37+
## Production build
38+
39+
### Disabling
3840

3941
With webpack:
4042

@@ -48,7 +50,28 @@ module.exports = {
4850
};
4951
```
5052

51-
### License
53+
### Removing the definitions with React
54+
55+
When you are using this package with React like API, you might want to save bandwidth by removing the definitions.
56+
You can use [babel-plugin-transform-react-remove-prop-types](https://github.com/oliviertassinari/babel-plugin-transform-react-remove-prop-types) for that use case, for instance:
57+
58+
```js
59+
// In
60+
const Baz = (props) => (
61+
<div {...props} />
62+
);
63+
64+
Baz.propTypes = {
65+
className: PropTypes.string
66+
};
67+
68+
// Out
69+
const Baz = (props) => (
70+
<div {...props} />
71+
);
72+
```
73+
74+
## License
5275

5376
BSD
5477

0 commit comments

Comments
 (0)