react-hoverstate

Simple state manager for react components

Usage no npm install needed!

<script type="module">
  import reactHoverstate from 'https://cdn.skypack.dev/react-hoverstate';
</script>

README

react-hoverstate

Simple state manager for react components

Get Started

Install

npm install react-hoverstate

or with yarn:

yarn add react-hoverstate

Use in react component

import :

import hoverstate from 'react-hoverstate';

get a state

<div>Hello {hoverstate.state.name}!</div>

setState

Like setState in react components.

<button onClick={()=>hoverstate.setState({check:true})}>Clic</button>

sync component

For updating component when states change.

componentDidMount()
{
    hoverstate.sync(this);
}