From 1dbe3e2dea6d171c5e3f90a289a30f7963ede5d2 Mon Sep 17 00:00:00 2001 From: Satyajit Sahoo Date: Mon, 30 Apr 2018 14:27:43 +0200 Subject: [PATCH] docs: document methods on TextInput and Searchbar --- docs/package.json | 2 +- docs/yarn.lock | 6 +++--- src/components/Searchbar.js | 31 +++++++++++++++++++++++-------- src/components/TextInput.js | 31 +++++++++++++++++++++++-------- src/components/Typography/Text.js | 3 +++ 5 files changed, 53 insertions(+), 20 deletions(-) diff --git a/docs/package.json b/docs/package.json index afd42a356f..462568e8ad 100644 --- a/docs/package.json +++ b/docs/package.json @@ -22,7 +22,7 @@ "license": "MIT", "dependencies": { "color": "^2.0.1", - "component-docs": "^0.11.4", + "component-docs": "^0.11.5", "linaria": "^0.5.0" } } diff --git a/docs/yarn.lock b/docs/yarn.lock index 9869c0f32e..7d8ebb069a 100644 --- a/docs/yarn.lock +++ b/docs/yarn.lock @@ -1552,9 +1552,9 @@ commondir@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" -component-docs@^0.11.4: - version "0.11.4" - resolved "https://registry.yarnpkg.com/component-docs/-/component-docs-0.11.4.tgz#ea97d08de2bd6dd77808d924787d3acea902a6a6" +component-docs@^0.11.5: + version "0.11.5" + resolved "https://registry.yarnpkg.com/component-docs/-/component-docs-0.11.5.tgz#c02749360f026267240a7b1d3d888469b4fb4019" dependencies: babel-core "^6.26.0" babel-loader "^7.1.4" diff --git a/src/components/Searchbar.js b/src/components/Searchbar.js index 56616aebe5..f90d3d2402 100644 --- a/src/components/Searchbar.js +++ b/src/components/Searchbar.js @@ -77,24 +77,39 @@ class Searchbar extends React.Component { _root: TextInput; + /** + * @internal + */ setNativeProps(...args) { return this._root.setNativeProps(...args); } - isFocused(...args) { - return this._root.isFocused(...args); + /** + * Returns `true` if the input is currently focused, `false` otherwise. + */ + isFocused() { + return this._root.isFocused(); } - clear(...args) { - return this._root.clear(...args); + /** + * Removes all text from the TextInput. + */ + clear() { + return this._root.clear(); } - focus(...args) { - return this._root.focus(...args); + /** + * Focuses the input. + */ + focus() { + return this._root.focus(); } - blur(...args) { - return this._root.blur(...args); + /** + * Removes focus from the input. + */ + blur() { + return this._root.blur(); } render() { diff --git a/src/components/TextInput.js b/src/components/TextInput.js index e1411a49b7..ae36b5dba2 100644 --- a/src/components/TextInput.js +++ b/src/components/TextInput.js @@ -194,24 +194,39 @@ class TextInput extends React.Component { this.props.onChangeText && this.props.onChangeText(value); }; + /** + * @internal + */ setNativeProps(...args) { return this._root.setNativeProps(...args); } - isFocused(...args) { - return this._root.isFocused(...args); + /** + * Returns `true` if the input is currently focused, `false` otherwise. + */ + isFocused() { + return this._root.isFocused(); } - clear(...args) { - return this._root.clear(...args); + /** + * Removes all text from the TextInput. + */ + clear() { + return this._root.clear(); } - focus(...args) { - return this._root.focus(...args); + /** + * Focuses the input. + */ + focus() { + return this._root.focus(); } - blur(...args) { - return this._root.blur(...args); + /** + * Removes focus from the input. + */ + blur() { + return this._root.blur(); } render() { diff --git a/src/components/Typography/Text.js b/src/components/Typography/Text.js index 3646e5abfc..1077abb8f2 100644 --- a/src/components/Typography/Text.js +++ b/src/components/Typography/Text.js @@ -21,6 +21,9 @@ type Props = { class Text extends React.Component { _root: NativeText; + /** + * @internal + */ setNativeProps(...args) { return this._root.setNativeProps(...args); }