@fstn/react-library
TypeScript icon, indicating that this package has built-in type declarations

1.0.842 • 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 />;
    }
}

Readme

Keywords

none

Package Sidebar

Install

npm i @fstn/react-library

Weekly Downloads

30

Version

1.0.842

License

SEE LICENSE IN LICENSE.md

Unpacked Size

5.98 MB

Total Files

118

Last publish

Collaborators

  • fstn