From 470ad3eaa09e54cdda1199894c39cb36b4f13f70 Mon Sep 17 00:00:00 2001 From: diegoolavarria Date: Sun, 23 Jun 2019 14:57:23 -0400 Subject: [PATCH] added proptypes to create React Function Component --- .../createReactFunctionComponent/getIndexContent.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/creators/createReactFunctionComponent/getIndexContent.js b/lib/creators/createReactFunctionComponent/getIndexContent.js index c579cdb..b70ea9e 100644 --- a/lib/creators/createReactFunctionComponent/getIndexContent.js +++ b/lib/creators/createReactFunctionComponent/getIndexContent.js @@ -19,13 +19,22 @@ export default function(name, isRN) { if (isRN) return forRN(name) return `import React from 'react' import styles from './styles.css' +import PropTypes from 'prop-types' -export default function ${name}(props) { +const propTypes = { + +} + +function ${name}(props) { return (
${name}
) } + +${name}.propTypes = propTypes + +export default ${name} ` }