2.1.13 • Published 10 months ago

react-js-ts-package v2.1.13

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

my-react-typescript-package

NPM version Build npm-typescriptLicense]github-license-url

This repo is the example of the article "How to create and publish React Typescript npm package with demo and automated build".

You can clone it and step by step create your own NPM package and publish it.

It is simple React counter.

Live Demo

Installation:

npm install react-typescript-package --save-dev

or

yarn add -D react-typescript-package

Usage :

Add MyCounter to your component:

import React from 'react'
import ReactDOM from 'react-dom/client'
import { MyCounter } from 'my-react-typescript-package'

const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement)
root.render(
    <React.StrictMode>
        <div>
            <h2>Default counter</h2>
            <MyCounter />
        </div>
        <hr />
        <div>
            <h2>Counter with predefined value</h2>
            <MyCounter value={5} />
        </div>
    </React.StrictMode>,
)
2.1.13

10 months ago

2.1.0

10 months ago

2.0.2

10 months ago

1.0.0

10 months ago