Current section

Files

Jump to
react_gleam src react_gleam@element.erl
Raw

src/react_gleam@element.erl

-module(react_gleam@element).
-compile(no_auto_import).
-export([node/3, text/1, 'div'/2, component/1]).
-export_type([element/0]).
-type element() :: any().
-spec node(
binary(),
list(react_gleam@attribute:attribute(any())),
list(element())
) -> element().
node(Field@0, Field@1, Field@2) ->
'../ffi.mjs':node(Field@0, Field@1, Field@2).
-spec text(binary()) -> element().
text(Field@0) ->
'../ffi.mjs':text(Field@0).
-spec 'div'(list(react_gleam@attribute:attribute(any())), list(element())) -> element().
'div'(Attributes, Children) ->
'../ffi.mjs':node(<<"div"/utf8>>, Attributes, Children).
-spec component(fun(() -> element())) -> element().
component(Field@0) ->
'../ffi.mjs':component(Field@0).