Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
JSX
SourceDeclaratively create HTML elements with JSX using OCaml/Reason.
let html: string = JSX.render (
<div>
<h1> {JSX.string("Hello, World!")} </h1>
</div>
)
The type that represents a JSX.element
Render a JSX.element to a string.
let html: string = JSX.render (
<div>
<h1> (JSX.string "Hello, World!") </h1>
</div>
)
The function to create a HTML DOM Node https://developer.mozilla.org/en-US/docs/Web/API/Node
. Given the tag, list of attributes and list of children.
JSX.node(
"a",
[JSX.Attribute.String(("href", "https://ocaml.org"))],
[JSX.string("OCaml")],
);
Helper to bypass HTML encoding and treat output as unsafe. This can lead to HTML scaping problems, XSS injections and other security concerns, use with caution.