From 5ce8498207ca1f2e9b8305cfca231c837b2d021b Mon Sep 17 00:00:00 2001 From: Cheng Lou Date: Wed, 12 Jun 2019 03:35:35 -0700 Subject: [PATCH] Remove external's `= ""` shorthand It's deprecated and discouraged --- src/React.re | 20 ++++++++++---------- src/ReactDOMRe.re | 2 +- src/ReasonReactRouter.re | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/React.re b/src/React.re index 0669a08bd..683478909 100644 --- a/src/React.re +++ b/src/React.re @@ -11,10 +11,10 @@ type componentLike('props, 'return) = 'props => 'return; type component('props) = componentLike('props, element); [@bs.module "react"] -external createElement: (component('props), 'props) => element = ""; +external createElement: (component('props), 'props) => element = "createElement"; [@bs.module "react"] -external cloneElement: (component('props), 'props) => element = ""; +external cloneElement: (component('props), 'props) => element = "cloneElement"; [@bs.splice] [@bs.module "react"] external createElementVariadic: @@ -28,7 +28,7 @@ module Ref = { [@bs.set] external setCurrent: (t('value), 'value) => unit = "current"; }; -[@bs.module "react"] external createRef: unit => Ref.t(Js.nullable('a)) = ""; +[@bs.module "react"] external createRef: unit => Ref.t(Js.nullable('a)) = "createRef"; module Children = { [@bs.module "react"] [@bs.scope "Children"] [@bs.val] @@ -57,16 +57,16 @@ module Context = { "Provider"; }; -[@bs.module "react"] external createContext: 'a => Context.t('a) = ""; +[@bs.module "react"] external createContext: 'a => Context.t('a) = "createContext"; [@bs.module "react"] external forwardRef: ([@bs.uncurry] (('props, Js.Nullable.t(Ref.t('a))) => element)) => component('props) = - ""; + "forwardRef"; [@bs.module "react"] -external memo: component('props) => component('props) = ""; +external memo: component('props) => component('props) = "memo"; [@bs.module "react"] external memoCustomCompareProps: @@ -122,13 +122,13 @@ module Suspense = { [@bs.module "react"] external useState: ([@bs.uncurry] (unit => 'state)) => ('state, ('state => 'state) => unit) = - ""; + "useState"; [@bs.module "react"] external useReducer: ([@bs.uncurry] (('state, 'action) => 'state), 'state) => ('state, 'action => unit) = - ""; + "useReducer"; [@bs.module "react"] external useReducerWithMapState: @@ -304,9 +304,9 @@ external useCallback7: callback('input, 'output) = "useCallback"; -[@bs.module "react"] external useContext: Context.t('any) => 'any = ""; +[@bs.module "react"] external useContext: Context.t('any) => 'any = "useContext"; -[@bs.module "react"] external useRef: 'value => Ref.t('value) = ""; +[@bs.module "react"] external useRef: 'value => Ref.t('value) = "useRef"; [@bs.module "react"] external useImperativeHandle0: diff --git a/src/ReactDOMRe.re b/src/ReactDOMRe.re index 0aeb70702..d61b3e913 100644 --- a/src/ReactDOMRe.re +++ b/src/ReactDOMRe.re @@ -2118,7 +2118,7 @@ include ( external apply: ('theFunction, 'theContext, 'arguments) => 'returnTypeOfTheFunction = - ""; + "apply"; let createElementVariadic = (domClassName, ~props=?, children) => { let variadicArguments = diff --git a/src/ReasonReactRouter.re b/src/ReasonReactRouter.re index 7c06cc679..1abf85047 100644 --- a/src/ReasonReactRouter.re +++ b/src/ReasonReactRouter.re @@ -7,7 +7,7 @@ external addEventListener: (Dom.window, string, unit => unit) => unit = [@bs.send] external removeEventListener: (Dom.window, string, unit => unit) => unit = - ""; + "removeEventListener"; [@bs.send] external dispatchEvent: (Dom.window, Dom.event) => unit = "dispatchEvent"; @@ -22,13 +22,13 @@ external dispatchEvent: (Dom.window, Dom.event) => unit = "dispatchEvent"; external pushState: (Dom.history, [@bs.as {json|null|json}] _, [@bs.as ""] _, ~href: string) => unit = - ""; + "pushState"; [@bs.send] external replaceState: (Dom.history, [@bs.as {json|null|json}] _, [@bs.as ""] _, ~href: string) => unit = - ""; + "replaceState"; [@bs.val] external event: 'a = "Event";