npm install add-react-componentGenerate the component boilerplate, CSS, and a shallow render test with one line.
Run
``npm install -g add-react-component`
`Generate PureComponent and shallow render test
$ add-react-component
Example
`sh
add-react-component example -c
`
Generates example folder with the following:index.js
`js
import Example from './example.js'export default Example
`style.css
`css
.container {}
`example.js
`js
import React, { PureComponent } from 'react'import style from './style.css'
class Example extends PureComponent {
render () {
return (
test
)
}
}export default Example
`example.test.js
`js
import React from 'react'
import { shallow } from 'enzyme'import Example from './example.js'
it('renders without props', () => {
shallow( )
})
``MIT © Jack Hanford