mirror of
https://github.com/terribleplan/next.js.git
synced 2024-01-19 02:48:18 +00:00
3d9564215c
The original example fails to compile on my windows machine but updating bs-platform fixes that. Depending on bs-next causes example to fail (package compiled with old incompatible version of bs-platform) so I have included it in a bindings directory where it can serve as an example of reason bindings. Sources have been migrated to the latest reason-react.
38 lines
1.1 KiB
ReasonML
38 lines
1.1 KiB
ReasonML
module Link = {
|
|
[@bs.module "next/link"] external link: ReasonReact.reactClass = "default";
|
|
let make =
|
|
(
|
|
~href=?,
|
|
~_as=?,
|
|
~prefetch: option(bool)=?,
|
|
~replace: option(bool)=?,
|
|
~shallow: option(bool)=?,
|
|
~passHref: option(bool)=?,
|
|
children,
|
|
) =>
|
|
ReasonReact.wrapJsForReason(
|
|
~reactClass=link,
|
|
~props=
|
|
Js.Undefined.{
|
|
"href": fromOption(href),
|
|
"as": fromOption(_as),
|
|
"prefetch": fromOption(prefetch),
|
|
"replace": fromOption(replace),
|
|
"shallow": fromOption(shallow),
|
|
"passHref": fromOption(passHref),
|
|
},
|
|
children,
|
|
);
|
|
};
|
|
|
|
module Head = {
|
|
[@bs.module "next/head"] external head: ReasonReact.reactClass = "default";
|
|
let make = children => ReasonReact.wrapJsForReason(~reactClass=head, ~props=Js.Obj.empty(), children);
|
|
};
|
|
|
|
module Error = {
|
|
[@bs.module "next/error"] external error: ReasonReact.reactClass = "default";
|
|
let make = (~statusCode: int, children) =>
|
|
ReasonReact.wrapJsForReason(~reactClass=error, ~props={"statusCode": statusCode}, children);
|
|
};
|