< 3kb React Alternative that works on top lf Vite
MIT License
Effortless UI, Powerful Simplicity
The project is built on top of Vite
This are the features that Vite provides:
There is a prepared Vite template ready to use that includes examples & TailwindCSS configured by default
git clone https://github.com/PiterWeb/ViteReverUITemplate.git
npm install
npm run dev
$useSignal:
import { $useSignal } from "reverui";
export default function StateFullApp() {
const mySignal = $useSignal("initValue");
return <div>...</div>;
}
$useEffect:
import { $useEffect, $useSignal } from "reverui";
export default function StateFullApp() {
$useEffect(() => {
console.log("Mounted");
});
const counter = $useSignal(0);
$useEffect(() => {
console.log("Counter value changed to " + counter.value);
}, [counter]);
return <div>...</div>;
}
Example Counter Component:
import { $useSignal, $useEffect } from "reverui";
export default function StateFullApp() {
// UseEffect with no dependencies before $useSignal will be called only on mount
$useEffect(() => {
console.log("Mounted");
});
const counter = $useSignal(0);
// const signal = $useSignal(initialValue);
// $useEffect with dependencies will be called only when the dependencies change
$useEffect(() => {
console.log("Counter value changed to " + counter.value);
}, [counter]);
return (
<div>
<h1>Stateful Component</h1>
<p>
{" "}
Counter: {counter.value === 0
? "You didn't click"
: counter.value}{" "}
</p>
<button onclick={() => counter.value++}>Increment</button>
</div>
);
}