squiggle/src/Index.re

30 lines
932 B
ReasonML
Raw Normal View History

2020-02-05 21:09:27 +00:00
// Entry point
[@bs.val] external document: Js.t({..}) = "document";
// We're using raw DOM manipulations here, to avoid making you read
// ReasonReact when you might precisely be trying to learn it for the first
// time through the examples later.
let style = document##createElement("style");
document##head##appendChild(style);
style##innerHTML #= ExampleStyles.style;
let makeContainer = text => {
let container = document##createElement("div");
container##className #= "container";
let title = document##createElement("div");
title##className #= "containerTitle";
title##innerText #= text;
let content = document##createElement("div");
content##className #= "containerContent";
let () = container##appendChild(title);
let () = container##appendChild(content);
let () = document##body##appendChild(container);
content;
};
2020-02-06 21:05:13 +00:00
ReactDOMRe.render(<Funds />, makeContainer("Reason Using JS Using Reason"));