example-typescript-react-component-library
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

Example typescript react component library

NPM LICENSE

An example project setup that allows for publishing a TypeScript React component module to npm.

Initially setup using create-react-library and converted to use TypeScript.

Project structure

The project contains a src directory containing the module files that get published to npm, and an example directory containing a working create-react-app project that contains an example usage of the module.

CI

This example also includes a .gitlab-ci.yml which publishes the module to npm (based on this guide) and deploys an example build to GitLab pages.

Development

Setup

Module

Whilst in the root directory, install dependencies

npm install

To run in watch mode

npm start

To build

npm run build

Example create-react-app

First, cd into the example directory

cd example

Install dependencies

npm install

To run development server

npm start

To build

npm run build

Contributing

Please read CONTRIBUTING.md.

Deployed Module

Install

npm install --save example-typescript-react-component-library

Usage

import * as React from "react";
 
import MyComponent from "example-typescript-react-component-library";
 
class Example extends React.Component {
    render() {
        return <MyComponent />;
    }
}

Package Sidebar

Install

npm i example-typescript-react-component-library

Weekly Downloads

0

Version

1.0.3

License

GPL-3.0-only

Unpacked Size

75.1 kB

Total Files

10

Last publish

Collaborators

  • straight-outta-crompton