Skip to content

Commit

Permalink
resolve ref thing in the same way we resolve all of our other curryin…
Browse files Browse the repository at this point in the history
…g things
  • Loading branch information
rickyvetter committed Feb 14, 2019
1 parent 86f87e1 commit 8d79227
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/React.re
Expand Up @@ -20,6 +20,9 @@ module Ref = {

type refForRecordAPI = Js.nullable(Dom.element) => unit;

type componentWithRef('props, 'refType) =
('props, option(t('refType))) => element;

/* These are both hacky internop things because React has n different ways of dealing with refs */
external refForRecordAPI: domRef => refForRecordAPI = "%identity";
external refForHooks: refForRecordAPI => domRef = "%identity";
Expand All @@ -30,11 +33,8 @@ type context('a);
[@bs.module "react"] external createContext: 'a => context('a) = "";

[@bs.module "react"]
[@deprecated
"Please use the `[@react.component {forwardRef: ref}]` api. Calling forwardRef by itself can lead to confusing compile and runtime errors."
]
external forwardRef:
(('props, option(Ref.t('a))) => element) => component('props) =
Ref.componentWithRef('props, 'refType) => component('props) =
"";

[@bs.module "react"]
Expand Down

0 comments on commit 8d79227

Please sign in to comment.