1.0.2 • Published 1 year ago

texsaur v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Texsaur

A simple jsx to DOM Node parser.

Overview

To create a DOM element in JavaScript, we could use document.createElement:

const div = document.createElement('div');
div.classList.add('example');
div.innerText = 'hello there';
div.addEventListener('click', () => console.log('clicked!'));

Texsaur lets you do this with jsx instead:

import jsx from 'texsaur';

const div = (
  <div class="example" 
       onclick={() => console.log('clicked!')}>
    Hello there
  </div>
) as HTMLElement;

Functional components are supported too:

const Example = ({ onClick }, children) => (
    <div class="example" onclick={onClick}>{children}</div>
);

const div = <Example onClick={() => console.log('clicked!')}>Hello there</Example>;

Here's a playground.

Documentation

Want help getting started? Check out the GitHub repository.

1.0.2

1 year ago

1.0.1

2 years ago

1.0.0

2 years ago

0.6.3

2 years ago

0.8.0

2 years ago

0.7.1

2 years ago

0.6.2

2 years ago

0.6.4

2 years ago

0.7.0

2 years ago

0.5.0

3 years ago

0.6.1

3 years ago

0.5.2

3 years ago

0.6.0

3 years ago

0.5.1

3 years ago

0.3.0

3 years ago

0.4.0

3 years ago

0.2.5

3 years ago

0.2.4

4 years ago

0.2.3

4 years ago

0.2.1

4 years ago

0.2.2

4 years ago

0.2.0

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago