Easy create new react modules with this tool
npm install -g react-modules-template
react-module <ComponentName> [--pure]
This will generate a Folder named Login relative to your current path and three files: an empty Login.scss and another file named Login.jsx filled with starter code for exporting a module with custom css.
If you would like to generate a stateless component you can pass in the
--pure flag after the componentName, this flag is optional. E.g:
react-module TableRow --pure, this will generate a pure function with the name of TableRow with a corresponding style file and a test file.
Install the package globally and then run the
--init command below.
--pure flag to generate stateless components.
Changed the main file to be named index.extension instead of componentName.extension, because I hated that I had to import it like this
import component from '/component/component'.
Now I can only import it like this:
import component from '/component'
Added functionality for a configuration file, added the
--init flag when running to create the config file.
Made it easier to customise to your own coding style and file structure.
Added a jest .js test file, the starter code only checks that it can be rendered, but it can be filled with more!
./Login --- index.[js|jsx] --- Login.test.js --- Login.[scss|css]