Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mainshayne233/react-component-boilerplate
Starting place for standalone React components (w/ dev server)
https://github.com/mainshayne233/react-component-boilerplate
boilerplate component demo dev react
Last synced: 25 days ago
JSON representation
Starting place for standalone React components (w/ dev server)
- Host: GitHub
- URL: https://github.com/mainshayne233/react-component-boilerplate
- Owner: MainShayne233
- Created: 2017-05-14T22:41:01.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-05-15T03:53:26.000Z (over 7 years ago)
- Last Synced: 2025-01-08T06:06:30.002Z (about 1 month ago)
- Topics: boilerplate, component, demo, dev, react
- Language: JavaScript
- Homepage:
- Size: 1.85 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# React Componet Boilerplate
Basic React component setup with a minimal server for both development and demo.
## Usage
Clone the repo into your own directory
```bash
git clone https://github.com/MainShayne233/react-component-boilerplate my-react-component
cd my-react-component
```Run setup the script
```bash
npm run setup
# Installs dependencies
# Removes boilerplate names
# Removes setup scripts
# Initializes Git
```Run development server
```bash
npm run start
# This runs the application that starts in ./src/main.js, which is just the
# development/demo app for your component, but is not included in the build.
```and visit [localhost:4000](http://localhost:4000)
## Testing
Tests go in the ```__tests__```, and you can run them with:
```bash
npm run test
```## Build
When you are ready to publish/use in applications, simply run the build script
```bash
npm run build
```This will produce an `index.js` file, which will expose the exports
listed in `src/index.js`Then you can just require/import like any React component:
```javascript
import { MyComponent } from 'my-component'
// or
const MyComponent = require('my-component').MyComponent
```