npm-package-first-arsalan-nury
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

package/npm-package-first-arsalan-nury

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 package/npm-package-first-arsalan-nury --save-dev

or

yarn add -D package/npm-package-first-arsalan-nury

Usage :

Add MyCounter to your component:

import React from 'react'
import ReactDOM from 'react-dom/client'
import { MyCounter } from 'package/npm-package-first-arsalan-nury'

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>,
)

Dependencies (0)

    Dev Dependencies (21)

    Package Sidebar

    Install

    npm i npm-package-first-arsalan-nury

    Weekly Downloads

    0

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    8.85 kB

    Total Files

    21

    Last publish

    Collaborators

    • arsalannury