package html_of_jsx

  1. Overview
  2. Docs

Module JSX.DebugSource

Provides ways to inspect a JSX.element.

Sourcetype html_element := element
Sourcetype 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

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.