mini-react-abhinav
v1.1.3
Published
A simple React-like library with JSX and state management
Maintainers
Readme
mini-react-by-abhinav_singh
A simple, lightweight, React-like library for building UI components with JSX.
Features
- JSX support with
React.createElement - State management with
useState - Side effects management with
useEffect - Child component nesting
Installation
npm install mini-react-abhinav
npm install -g parcel-bundler
npm install ##jo bhi bacha hai wo install ho jayega
npm run build
##or
npm install mini-react-abhinav
npm install --save-dev parcel @babel/preset-react
import { React, ReactDOM, useState, useEffect } from "mini-react-abhinav";
/** @jsx React.createElement */
const App = () => {
const [count, setCount] = useState(0);
useEffect(() => {
console.log(`Count updated: ${count}`);
}, [count]);
return (
<div style={{ padding: "20px", fontFamily: "Arial" }}>
<h1 style={{ backgroundColor: "orange", color: "white", fontSize: "30px" }}>
Hello Abhinav with Hooks!
</h1>
<p>Count: {count}</p>
<button
style={{ padding: "10px", fontSize: "16px" }}
onClick={() => setCount(count + 1)}
>
Increment
</button>
</div>
);
};
const root = document.getElementById("root");
ReactDOM.render(App, root); // pass App, not App()