1.0.1 • Published 5 months ago
building-blocks-testing v1.0.1
react-npm-boilerplate
Boiler plate code for creating a new react npm component. Just clone this project and start building your npm package for react components.
Steps
- Clone this project
- rm -rf .git && git init - This will remove the exisintg git repo and will initialize a new one
- Change {your roject name}, {author name} and {author email} in package.json
- Now run - npm run build
- This will create a build file build/index.js
Now run - npm link - This will link the project with the name you gave
!! Wow now you are done create your npm module !!
Let's create a sample project to test it out
- npm i -g create-react-app
- mkdir react-project-test
- cd react-project-test
- create-react-app .
- npm link {your project name}
Open src/App.js, import and add your component to it. Run - npm start
open http://localhost:3000 You should be able to see your component rendering on that page.