0.2.10 • Published 3 years ago
@knowink-dev/material-components v0.2.10
KNOWiNK Material Components
This is the material component library used across single spa applictions running react.
Usage
Install
npm i --save @knowink/material-components
Import and use
import React from 'react';
import { Sample } from '@knowink/material-components';
export default () => <Sample />
Testing
One-off test
If you need to test for deployment, run the one-off test
npm test
Watch
If you are in development and need to TDD
npm run test:watch
Storybook
Component development is done through storybook. Each component has a corresponding story and docs. To run storybook -
npm run storybook
If you happened to have react linked from a single spa, you will have to remove that link.
cd /path/to/component/repo
npm unlink react
If that fails to unlink try
rm -rf /path/to/component/repo/node_modules/react
npm i
Linking
Since you cannot have two instances of react going at once, you cannot link this repo into a single spa application and expect it to work. There is a work-around. First backlink this repo to the spa.
cd /path/to/component/repo
npm link /path/to/single/spa/node_modules/react
cd /path/to/single/spa
npm link /path/to/component/repo
npm start