Skip to content

fix TypeScript typings for TextInput methods#753

Merged
satya164 merged 1 commit into
callstack:masterfrom
Nkzn:fix-textinput-public-method-types
Jan 24, 2019
Merged

fix TypeScript typings for TextInput methods#753
satya164 merged 1 commit into
callstack:masterfrom
Nkzn:fix-textinput-public-method-types

Conversation

@Nkzn

@Nkzn Nkzn commented Jan 24, 2019

Copy link
Copy Markdown

Motivation

  • paper version: v2.6.1
  • typescript version: v3.2.2

The TextInput class has public methods isFocused, clear, focus, blur.

https://github.com/callstack/react-native-paper/blob/v2.6.1/src/components/TextInput.js#L348-L374

However, they are not declared in d.ts as below.

2019-01-24 17 51 02

Test plan

Typecheck for below function.

import { TextInput } from "react-native-paper";

function doAnything(textInput: TextInput) {
  textInput.isFocused();
  textInput.clear();
  textInput.focus();
  textInput.blur();
}

@satya164
satya164 merged commit 4c918ff into callstack:master Jan 24, 2019
@satya164

Copy link
Copy Markdown
Member

Thank you for the PR!

@callstack-bot

Copy link
Copy Markdown

Hey @Nkzn, thank you for your pull request 🤗. The documentation from this branch can be viewed here. Please remember to update Typescript types if you changed API.

@Nkzn
Nkzn deleted the fix-textinput-public-method-types branch January 24, 2019 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants