Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added proptypes to create React Function Component #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion lib/creators/createReactFunctionComponent/getIndexContent.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div className={styles.container}>
${name}
</div>
)
}

${name}.propTypes = propTypes

export default ${name}
`
}