Skip to content

SoloJSX/SoloJSX

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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