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.
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
: