solojsx
v1.2.7
Published
SoloJSX
Downloads
84
Maintainers
Readme
- :sun_with_face: JSX that returns nodes
- :gem: Supports Attributes & Events
- :tada: No Virtual DOM
- :zap: Small size (285 B)
Getting started
Using npx
In current folder
npx create-solojsx-app
In new folder
npx create-solojsx-app project-name
Using bun
In current folder
bunx create-solojsx-app-bun
In new folder
bunx create-solojsx-app-bun project-name
Usage
import solojsx from 'solojsx';
const element = (
<div>
<h1>SoloJSX</h1>
<p>SoloJSX is a library that returns nodes from JSX</p>
</div>
);
document.body.appendChild(element);
With attributes and events
const onClick = (text: string) => alert(text);
const e = <div style="color: red" onclick={() => onClick("Hi")}>Click Me</div>;
Using an array
const e = <div>
List of divs:
<br />
{[1, 2, 3].map(i => <div>{i}</div>)}
</div>;
License
MIT