0.1.1 • Published 6 years ago

thunder-lib v0.1.1

Weekly downloads
2
License
(ISC OR GPL-3.0)
Repository
-
Last release
6 years ago

ThunderUI

https://medium.com/@chimera.zen/how-to-use-create-react-app-to-publish-an-npm-package-3f29909a36db

This project was bootstrapped with Create React App

Development

Development should be done in conjunction with storybook.

Components

New components should be given a new folder within components.

Once the component has been stubbed out, create a story for that component. This is how you will actually use and test the component.

An example component folder:

  • table
    • Table.tsx
    • Table.test.tsx
    • Table.stories.tsx

Table.stories.tsx example:

import { storiesOf } from '@storybook/react';
import * as React from 'react';
import Table from "./Table";

const defaultTableProps = {
    columns: [...],
    rows: [...]
}

const complexTableProps = {
    columns: [...],
    rows: [...],
    sortable: true
}

storiesOf("Table", module)
    .add("with text", () => (
        <Table {...defaultTableProps} />
    ))
    .add("with some emoji", () => (
        <Table {...complexTableProps} />
    ));

To watch file changes:

$ yarn run storybook.

Navigate to your component and watch changes there.

Utilities

WIP