Skip to content

Commit 129ed40

Browse files
committed
Fixed TextInput ref.
1 parent b1d1f3b commit 129ed40

1 file changed

Lines changed: 9 additions & 4 deletions

File tree

‎bs-react-native-next/src/components/TextInput.re‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
type element;
2+
type ref = React.Ref.t(Js.nullable(element));
3+
14
type event('a) = {. "nativeEvent": 'a};
25

36
type editingEvent =
@@ -43,6 +46,8 @@ type keyPressEvent = event({. "key": string});
4346
[@react.component] [@bs.module "react-native"]
4447
external make:
4548
(
49+
~ref: ref=?,
50+
// TextInput props
4651
~allowFontScaling: bool=?,
4752
~autoCapitalize: [@bs.string] [
4853
| `characters
@@ -272,10 +277,10 @@ external make:
272277
React.element =
273278
"TextInput";
274279

275-
[@bs.send] external isFocused: ReasonReact.reactRef => bool = "";
280+
[@bs.send] external isFocused: ref => bool = "";
276281

277-
[@bs.send] external clear: ReasonReact.reactRef => unit = "";
282+
[@bs.send] external clear: ref => unit = "";
278283

279-
[@bs.send] external focus: ReasonReact.reactRef => unit = "";
284+
[@bs.send] external focus: ref => unit = "";
280285

281-
[@bs.send] external blur: ReasonReact.reactRef => unit = "";
286+
[@bs.send] external blur: ref => unit = "";

0 commit comments

Comments
 (0)