Skip to content

A JSX-powered templating library for building multi page websites.

License

Notifications You must be signed in to change notification settings

TheKnarf/isomorphic-jsx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub license NpmVersion Build Status Coverage Status Gitter

A JSX-powered templating library for building multi page websites, use the JSX syntax both in the browser and in Node.js. A powerfull library in under 100 lines of code!

npm install --save isomorphic-jsx
npm install --save-dev @babel/core @babel/preset-react

You also need to install and setup babel with the react preset for babel preset.

Usage

You need to setup the following in .babelrc:

{
  presets: [
    [ '@babel/preset-react', {
        pragma: 'dom',
        throwIfNamespace: false
    }]
  ]
}

An example of a simple test case:

import { dom } from 'isomorphic-jsx';

const Test = ({children}) => <div>{children}</div>;

console.log( <Test>tester</Test> ); // "<div>tester</div>"

Example repos that use isomorphic-jsx: