Skip to content

Commit 1dbe3e2

Browse files
committed
docs: document methods on TextInput and Searchbar
1 parent 89fd20e commit 1dbe3e2

File tree

5 files changed

+53
-20
lines changed

5 files changed

+53
-20
lines changed

docs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"license": "MIT",
2323
"dependencies": {
2424
"color": "^2.0.1",
25-
"component-docs": "^0.11.4",
25+
"component-docs": "^0.11.5",
2626
"linaria": "^0.5.0"
2727
}
2828
}

docs/yarn.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -1552,9 +1552,9 @@ commondir@^1.0.1:
15521552
version "1.0.1"
15531553
resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b"
15541554

1555-
component-docs@^0.11.4:
1556-
version "0.11.4"
1557-
resolved "https://registry.yarnpkg.com/component-docs/-/component-docs-0.11.%3Cspan%20class="x x-first x-last">4.tgz#ea97d08de2bd6dd77808d924787d3acea902a6a6"
1555+
component-docs@^0.11.5:
1556+
version "0.11.5"
1557+
resolved "https://registry.yarnpkg.com/component-docs/-/component-docs-0.11.%3Cspan%20class="x x-first x-last">5.tgz#c02749360f026267240a7b1d3d888469b4fb4019"
15581558
dependencies:
15591559
babel-core "^6.26.0"
15601560
babel-loader "^7.1.4"

src/components/Searchbar.js

+23-8
Original file line numberDiff line numberDiff line change
@@ -77,24 +77,39 @@ class Searchbar extends React.Component<Props> {
7777

7878
_root: TextInput;
7979

80+
/**
81+
* @internal
82+
*/
8083
setNativeProps(...args) {
8184
return this._root.setNativeProps(...args);
8285
}
8386

84-
isFocused(...args) {
85-
return this._root.isFocused(...args);
87+
/**
88+
* Returns `true` if the input is currently focused, `false` otherwise.
89+
*/
90+
isFocused() {
91+
return this._root.isFocused();
8692
}
8793

88-
clear(...args) {
89-
return this._root.clear(...args);
94+
/**
95+
* Removes all text from the TextInput.
96+
*/
97+
clear() {
98+
return this._root.clear();
9099
}
91100

92-
focus(...args) {
93-
return this._root.focus(...args);
101+
/**
102+
* Focuses the input.
103+
*/
104+
focus() {
105+
return this._root.focus();
94106
}
95107

96-
blur(...args) {
97-
return this._root.blur(...args);
108+
/**
109+
* Removes focus from the input.
110+
*/
111+
blur() {
112+
return this._root.blur();
98113
}
99114

100115
render() {

src/components/TextInput.js

+23-8
Original file line numberDiff line numberDiff line change
@@ -194,24 +194,39 @@ class TextInput extends React.Component<Props, State> {
194194
this.props.onChangeText && this.props.onChangeText(value);
195195
};
196196

197+
/**
198+
* @internal
199+
*/
197200
setNativeProps(...args) {
198201
return this._root.setNativeProps(...args);
199202
}
200203

201-
isFocused(...args) {
202-
return this._root.isFocused(...args);
204+
/**
205+
* Returns `true` if the input is currently focused, `false` otherwise.
206+
*/
207+
isFocused() {
208+
return this._root.isFocused();
203209
}
204210

205-
clear(...args) {
206-
return this._root.clear(...args);
211+
/**
212+
* Removes all text from the TextInput.
213+
*/
214+
clear() {
215+
return this._root.clear();
207216
}
208217

209-
focus(...args) {
210-
return this._root.focus(...args);
218+
/**
219+
* Focuses the input.
220+
*/
221+
focus() {
222+
return this._root.focus();
211223
}
212224

213-
blur(...args) {
214-
return this._root.blur(...args);
225+
/**
226+
* Removes focus from the input.
227+
*/
228+
blur() {
229+
return this._root.blur();
215230
}
216231

217232
render() {

src/components/Typography/Text.js

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ type Props = {
2121
class Text extends React.Component<Props> {
2222
_root: NativeText;
2323

24+
/**
25+
* @internal
26+
*/
2427
setNativeProps(...args) {
2528
return this._root.setNativeProps(...args);
2629
}

0 commit comments

Comments
 (0)