Skip to content

Commit c4fdbc2

Browse files
committed
Recommend exporting propTypes as a named export
By exporting `propTypes` as a named export *as well* as attaching them to the "class", they can be explicitly imported by tests and other components in a way that aligns with the future ES6 module dependency graph, rather than as an arbitrary property that isn't statically verifiable. Doing both is great imo. Thoughts?
1 parent 909fc8b commit c4fdbc2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

react/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@
262262
```javascript
263263
import React, { Component, PropTypes } from 'react';
264264

265-
const propTypes = {
265+
export const propTypes = {
266266
id: PropTypes.number.isRequired,
267267
url: PropTypes.string.isRequired,
268268
text: PropTypes.string,

0 commit comments

Comments
 (0)