Skip to content

vajadzneladze/another-react-js-lib

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commits
 
 

Repository files navigation

my-react-typescript-package

NPM version Build npm-typescript License

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 my-react-typescript-package --save-dev

or

yarn add -D my-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>,
)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published