1.0.1 • Published 11 months ago

texsaur v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months 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.1

11 months ago

1.0.0

11 months ago

0.6.3

1 year ago

0.8.0

1 year ago

0.7.1

1 year ago

0.6.2

1 year ago

0.6.4

1 year ago

0.7.0

1 year ago

0.5.0

2 years ago

0.6.1

2 years ago

0.5.2

2 years ago

0.6.0

2 years ago

0.5.1

2 years ago

0.3.0

2 years ago

0.4.0

2 years ago

0.2.5

2 years ago

0.2.4

3 years ago

0.2.3

3 years ago

0.2.1

3 years ago

0.2.2

3 years ago

0.2.0

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago