solojsx
TypeScript icon, indicating that this package has built-in type declarations

1.2.7 • Public • Published

alt text

npm npm npm package minimized gzipped size GitHub

  • 🌞 JSX that returns nodes
  • 💎 Supports Attributes & Events
  • 🎉 No Virtual DOM
  • ⚡ 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

Package Sidebar

Install

npm i solojsx

Weekly Downloads

1

Version

1.2.7

License

MIT

Unpacked Size

4.1 kB

Total Files

5

Last publish

Collaborators

  • jgtools