From c4fdbc2742367ac33d4297de525f8fa246f5dae6 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Mon, 17 Aug 2015 20:42:58 -0700 Subject: [PATCH] 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? --- react/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/react/README.md b/react/README.md index 3c01981f..8d02bcca 100644 --- a/react/README.md +++ b/react/README.md @@ -262,7 +262,7 @@ ```javascript import React, { Component, PropTypes } from 'react'; - const propTypes = { + export const propTypes = { id: PropTypes.number.isRequired, url: PropTypes.string.isRequired, text: PropTypes.string,