package html_of_jsx

  1. Overview
  2. Docs
Render HTML with JSX

Install

dune-project
 Dependency

Authors

Maintainers

Sources

html_of_jsx-0.0.6.tbz
sha256=7f4aeaaa9df466b72ab2bf14bcc1b908789c67187781cb4c78ee5eb7d22697d8
sha512=31ef6fa8e80dac79d8806c08a64a5cb600f703309417bff917bfc8a6b72237383493eb3c13aade3059b17f0e3102aeba9cb358934c6f1541749ea9443037d791

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" />);