''' npm install --save react-modal-simple
import Modal from 'react-modal-simple' import 'react-modal-simple/dist/styles.css' '''
npm start localhost:3001
- To build dist of demo - npm run build
- To deploy demo to ghpages - npm run deploy OR npm run publish-demo (combines above steps)
Whenever you are ready to publish a new version, simply increment the version in package.json, and then run npm publish and npm run publish-demo
Step by step instruction to publish component to npm from scratch https://medium.com/dailyjs/building-a-react-component-with-webpack-publish-to-npm-deploy-to-github-guide-6927f60b3220
Additionally,
- Install as dev dependency - npm install prop-types -D
- Install as dev dependency - npm install babel-preset-stage-2 -D // babel-preset-stage-2 will help run es6
- Update .babelrc config, add plugins .babelrc { "presets": ["env", "react"], "plugins": [ "transform-object-rest-spread", "transform-class-properties", ] }