loyality_typescript_lib_test_package
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

loyality_typescript_lib_test_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 loyality_typescript_lib_test_package --save-dev

or

yarn add -D loyality_typescript_lib_test_package

Usage :

Add MyCounter to your component: Add AllArticle to your component: Add Article to your component: Add AllRewards to your component: Add Reward to your component: Add LoyalityCart to your component:

import React from 'react'
import ReactDOM from 'react-dom/client'
import { MyCounter } from 'loyality_typescript_lib_test_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>
        <hr />
        <div>
            <h2>Article list</h2>
            <AllArticle />
        </div>
        <hr />
        <div>
            <h2>Article Details</h2>
            <Article />
        </div>
        <hr />
        <div>
            <h2>All Rewards</h2>
            <AllRewards />
        </div>
        <hr />
        <div>
            <h2>Reward Details</h2>
            <Reward />
        </div>
        <hr />
        <div>
            <h2>Cart</h2>
            <LoyalityCart />
        </div>
    </React.StrictMode>,
)

Package Sidebar

Install

npm i loyality_typescript_lib_test_package

Weekly Downloads

2

Version

0.2.0

License

MIT

Unpacked Size

23 kB

Total Files

67

Last publish

Collaborators

  • nileshlundwani789