package html_of_jsx

  1. Overview
  2. Docs
Render HTML with JSX

Install

dune-project
 Dependency

Authors

Maintainers

Sources

html_of_jsx-0.0.7.tbz
sha256=83b5437638815bb3d9c152a31f2125fda1989d6fc7d86774fbbfa4c90d0d8ea8
sha512=8c1f72403083b714beac9bf0676e0e3d2fef7a7b6891a9ae9d40487ac6aa85e53fc80566be39b1623c94678c957b6da8c772fe36ccc5e8d3a9a74bb5d471fe93

doc/react.html

Enable React attributes

(Experimental)

Support React properties as attributes in all HTML and SVG elements.

React properties

React properties are renamed to match the React DOM API. The rendered HTML won't have any reactisms. For example, `className` is renamed to `class`, `htmlFor` is renamed to `for`, etc.

Those react properties are additional, HTML and SVG attributes are still correct. For example, `class` is still valid, and `className` is also valid.

Why

This mode is a way help to migrate away from (or migrate to) React

Enable

Adding the -react flag into the ppx

  (libraries html_of_jsx)
  (preprocess (pps html_of_jsx.ppx -react))

Example

JSX.render(<div className="random" />);