/react-component-example

A minimal setup to develop and publish a React Component.

Primary LanguageJavaScript

React Component Example

A minimal setup to develop and publish a React Component.

Steps

  1. Clone this repo:
git clone git@github.com:mllocs/react-component-example.git
  1. Edit the package.json (update the component name, author, ...).

  2. Install the npm packages, link the library and run the build watch if you want to work on the component while testing it from another project:

npm install
npm link
npm run build:watch
  1. Use the component from another project. From the root of the other project run:
npm link react-component-example # Update accordingly

and use it as you would use any other component:

import Example from 'react-component-example'; // Update accordingly