Early stage CLI tool for staging react components with a zero config webpack dev server (based on create-react-app).
npm install react-sketchbook
The React-Sketchbook CLI takes one argument (a filename). It injects the default export of given file into the staging environment and does nothing else (right now).
So given a module like this:
// some-react-component.js const SomeComponent = () => ( <div>Hello World</div> ); export default SomeComponent;
You can point the cli at the file above
React-Sketchbook will render the component in staging environment.
If you include other folders than
node_modules in your paths you can add them with the
-p option, separated by comma:
sketch some-react-component.js -p ../local_modules,../lib
That way if you have a module in
../local_modules/some-module.js you can import it like this:
import someModule from 'some-module';