[![NPM version][npm-image]][npm-url] [![Build][github-build]][github-build-url] ![npm-typescript] [![License][github-license]][github-license-url]
npm install streamlit-react-modal[![NPM version][npm-image]][npm-url]
[![Build][github-build]][github-build-url]
![npm-typescript]
[![License][github-license]][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.
``bash`
npm install my-react-typescript-package --save-dev
or
`bash`
yarn add -D my-react-typescript-package
Add MyCounter to your component:
`js
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(
Default counter
Counter with predefined value
)
``
[npm-url]: https://www.npmjs.com/package/my-react-typescript-package
[npm-image]: https://img.shields.io/npm/v/my-react-typescript-package
[github-license]: https://img.shields.io/github/license/gapon2401/my-react-typescript-package
[github-license-url]: https://github.com/gapon2401/my-react-typescript-package/blob/master/LICENSE
[github-build]: https://github.com/gapon2401/my-react-typescript-package/actions/workflows/publish.yml/badge.svg
[github-build-url]: https://github.com/gapon2401/my-react-typescript-package/actions/workflows/publish.yml
[npm-typescript]: https://img.shields.io/npm/types/my-react-typescript-package