yarn add @debtcollective/header
import React, { Component } from 'react'
import Header from @debtcollective/header
class Example extends Component {
render () {
return (
<Header />
)
}
}
Check package.json peerDependencies
.
In the project directory, the principal commands you may want to know are:
Runs Rollup in watch mode
Builds the package using Rollup
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
Launches a server with components documentation.
To run the example run:
cd example
yarn install
yarn start
This app is based on create-react-app, serving 2 purposes
- Local, hot-reload server for developing your module
- Easily publishable to github pages
- We use semantic commits throught https://commitizen.github.io/cz-cli/
- While Material UI support
withStyles
we prefer the usage of https://www.styled-components.com to do so, often needing to apply extra specificity to allow styles to being applied - Some UI pieces from Material UI needs unique identifiers, so we use constants in the same file but with a format to avoid conflicts like so:
const <ELEMENT_TYPE>_NAME = "@@<scope>/<component>/<element_type>";
BSD-3-Clause © @debtcollective