lensconfigurator-package
v1.1.1
Published
New Lens configurator component
Downloads
1
Maintainers
Readme
lensconfigurator-package
[![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.
Installation:
npm install lensconfigurator-component --save-dev
or
yarn add -D lensconfigurator-component
Usage :
Add LensConfigurator
to your component:
import React from 'react'
import ReactDOM from 'react-dom/client'
import { LensConfigurator } from 'lensconfigurator-component'
const root = ReactDOM.createRoot(document.getElementById('root') as HTMLElement)
root.render(
<React.StrictMode>
<div>
<h2>Default counter</h2>
<LensConfigurator />
</div>
<hr />
<div>
<h2>Counter with predefined value</h2>
<LensConfigurator value={5} />
</div>
</React.StrictMode>,
)