React + Webpack based boilerplate for producing React components
Starter project for creating libraries
https://jfusco.github.io/react-library-boilerplate
From the root of your project.
npm install library --save
Implementation of component. See available options below.
import React, { Component } from 'react';
import { render } from 'react-dom';
render(<Application ></Application>, document.getElementById('application'));
The foo
of the component - used for setting up foo
<Component foo="bar" ></Component>
Import the main SCSS file in to your application SCSS files
@import "node_modules/component/src/component/scss/styles.scss";
There are a few variables set to !default
that can be overriden. If you need to change it more just override the actual styles.
Any overriden variables needs to go above the @import
statement to take effect
//-- Global UI
$component-width
If you don’t care to override variables and just want to override actual styles you may choose to import the minified compiled version of the css instead
@import "node_modules/component/dist/styles.css";
npm test