Skip to content

Commit

Permalink
Merge pull request #3 from ctbucha/className
Browse files Browse the repository at this point in the history
Add className attribute to GatsbyLink
  • Loading branch information
jtberglund committed Oct 26, 2018
2 parents b64ad99 + 1ef8669 commit 8d3d4ba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
9 changes: 5 additions & 4 deletions src/GatsbyLink.re
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
[@bs.module "gatsby"]
external gatsbyLink : ReasonReact.reactClass = "Link";
[@bs.module "gatsby"] external gatsbyLink : ReasonReact.reactClass = "Link";

[@bs.module "gatsby"] external navigateTo : string => unit = "navigateTo";

[@bs.module "gatsby"]
external withPrefix : string => string = "withPrefix";
[@bs.module "gatsby"] external withPrefix : string => string = "withPrefix";

[@bs.deriving abstract]
type jsProps = {
Expand All @@ -15,6 +13,7 @@ type jsProps = {
innerRef: Js.nullable(ReasonReact.reactRef),
onClick: Js.nullable(ReactEvent.Mouse.t => unit),
activeClassName: Js.nullable(string),
className: Js.nullable(string),
exact: Js.nullable(bool),
strict: Js.nullable(bool),
};
Expand Down Expand Up @@ -42,6 +41,7 @@ let make =
~innerRef: option(ReasonReact.reactRef)=?,
~onClick: option(ReactEvent.Mouse.t => unit)=?,
~activeClassName: option(string)=?,
~className: option(string)=?,
~exact: option(bool)=?,
~strict: option(bool)=?,
children,
Expand All @@ -54,6 +54,7 @@ let make =
~style=Js.Nullable.fromOption(style),
~onClick=Js.Nullable.fromOption(onClick),
~activeClassName=Js.Nullable.fromOption(activeClassName),
~className=Js.Nullable.fromOption(className),
~exact=Js.Nullable.fromOption(exact),
~strict=Js.Nullable.fromOption(strict),
);
Expand Down
3 changes: 2 additions & 1 deletion src/GatsbyLink.rei
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ let make:
~innerRef: ReasonReact.reactRef=?,
~onClick: ReactEvent.Mouse.t => unit=?,
~activeClassName: string=?,
~className: string=?,
~exact: bool=?,
~strict: bool=?,
'a
Expand All @@ -16,4 +17,4 @@ let make:
ReasonReact.actionless,
);
let navigateTo: string => unit;
let withPrefix: string => string;
let withPrefix: string => string;

0 comments on commit 8d3d4ba

Please sign in to comment.