Skip to content

jslba/jsx-lite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JSX Lite

npm GitHub

The philosophy of this project is to provide a light and fast structure to allow the use of the JSX syntax in a JavaScript application to increase your productivity and the maintainability of your project !

All JSX chunk are valid HTMLElement which can then be manipulated as you wish.

Note
If you want to know how to use it, you can see some examples here.

Demonstration :

// classic JS chunk :
var p = document.createElement("p");
p.appendChild(
   document.createTextNode("Hello World")
);
var main = document.createElement("main");
main.setAttribute("class", "light");
main.appendChild(p);
document.body.appendChild(main);

// becomes :
document.body.appendChild(
   <main class="light">
      <p>Hello World</p>
   </main>
);

⚠️ Warning ⚠️

Currently the project does not support :

  • the JSX fragments like <> ... </> or <React.Fragment />.
  • custom elements like <CustomJSXElement />.

No planned JSX fragments support (for now) ; because I cannot find any concrete case requiring the use of fragments ; most can be solved with the use of array and append instead of appendChild.

About

A minimalist and lite JSX alternative to React and co.

Resources

License

Stars

0 stars

Watchers

1 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors