An open API service indexing awesome lists of open source software.

https://github.com/fabiosantoscode/tjsx

Like mikeal's bel but for React. Tired of compiling JSX in development? Use this!
https://github.com/fabiosantoscode/tjsx

Last synced: 6 months ago
JSON representation

Like mikeal's bel but for React. Tired of compiling JSX in development? Use this!

Awesome Lists containing this project

README

          

# tjsx

[![Build Status](https://travis-ci.org/fabiosantoscode/tjsx.svg?branch=master)](https://travis-ci.org/fabiosantoscode/tjsx)

Use React without a transpiler!

## Features

- No transpilation required! ES6 tagged template string literals are a part of the language!
- Works on client, server and native.
- Interops with your existing JSX code. No need to rush!
- Tiny codebase - you can hope to understand it if you have any problems, and there's a smaller chance of there being bugs.
- `xml:id` and other XML namespaced attributes simply work! Also SVG namespaced tags such as `` just work.

## Example

```javascript
const tjsx = require('tjsx')

// Look ma, no transpilers!
function YourComponent({ kind }) {
const className = `foo foo__${kind}`
return tjsx`

this.onClick(e)} />`
}
```

## Interpolating strings

```javascript
const tjsx = require('tjsx')

function AmazingTitle({ name = 'Fábio' }) {
return tjsx`

Hello, ${name}


`
}
```

## Using other components

```javascript
const tjsx = require('tjsx')
const OneComponent = require('react-some-component')

function AnotherComponent() {
return tjsx`

foo!
`
}

function ParentComponent(props) {
return tjsx`


<${OneComponent} prop1="foo">
${props.children}
>
<${AnotherComponent} />

`
}
```