-
-
Save idkjs/e9602dee116ffc44da62bfd9dfdb49d7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | |
| }, | |
| children | |
| ); | |
| }; | |
| module BrowserRouter = { | |
| [@bs.module "react-router-dom"] external reactClass : ReasonReact.reactClass = "BrowserRouter"; | |
| let make = (children) => | |
| ReasonReact.wrapJsForReason(~reactClass, ~props=Js.Obj.empty(), children); | |
| }; | |
| module Link = { | |
| [@bs.module "react-router-dom"] external reactClass : ReasonReact.reactClass = "Link"; | |
| let make = (~to_, children) => | |
| ReasonReact.wrapJsForReason(~reactClass, ~props={"to": to_}, children); | |
| }; | |
| module Switch = { | |
| [@bs.module "react-router-dom"] external reactClass : ReasonReact.reactClass = "Switch"; | |
| let make = (children) => | |
| ReasonReact.wrapJsForReason(~reactClass, ~props=Js.Obj.empty(), children); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment