npm install --save kladi
import { Provider, useGlobalState } from "kladi";
import React from "react";
import ReactDOM from "react-dom";
import App from "./App";
ReactDOM.render(
<Provider>
<App />
</Provider>,
document.getElementById("root")
);
const App = (props) => {
let [count, setCount] = useGlobalState("count", 0);
return (
<div>
{count}
<button
onClick={() => {
setCount(count + 1);
}}
>
Press
</button>
</div>
);
};
MIT © Tech Phantoms