package html_of_jsx

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Provides ways to inspect a JSX.element.

type html_element := element
type element =
  1. | Null
  2. | String of string
  3. | Unsafe of string
  4. | Node of {
    1. tag : string;
    2. attributes : attribute list;
    3. children : element list;
    }
  5. | List of element list
val view : html_element -> element

A function to inspect a JSX.element.

let debug: JSX.Debug.__element =
  JSX.Debug.view(
    <div>
      <h1> {JSX.string("Hello, World!")} </h1>
    </div>
  );

switch (debug) {
  | JSX.Debug.Node {tag; attributes; children} -> Printf.printf("Node: %s", tag)
  | _ -> ()
}
OCaml

Innovation. Community. Security.