Skip to content

Instantly share code, notes, and snippets.

@SllyQ
SllyQ / Dnd.re
Created November 14, 2017 11:27
open ExtUtils;
module DragDropContext = {
[@bs.module "react-beautiful-dnd"] external reactClass : ReasonReact.reactClass =
"DragDropContext";
Js.log(reactClass);
let make = (~onDragEnd, children) =>
ReasonReact.wrapJsForReason(~reactClass, ~props={"onDragEnd": onDragEnd}, children);
};
module Route = {
[@bs.module "react-router-dom"] external reactClass : ReasonReact.reactClass = "Route";
let make = (~component=?, ~render=?, ~exact=?, ~path=?, children) =>
ReasonReact.wrapJsForReason(
~reactClass,
~props={
"path": path |> Js.Nullable.from_opt,
"render": render |> Js.Nullable.from_opt,
"component": component |> Js.Nullable.from_opt,
"exact": exact |> ExtUtils.jsOptBool |> Js.Nullable.from_opt