Skip to content

Commit

Permalink
docs: document methods on TextInput and Searchbar
Browse files Browse the repository at this point in the history
  • Loading branch information
satya164 committed Apr 30, 2018
1 parent 89fd20e commit 1dbe3e2
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 20 deletions.
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
6 changes: 3 additions & 3 deletions docs/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
31 changes: 23 additions & 8 deletions src/components/Searchbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,24 +77,39 @@ class Searchbar extends React.Component<Props> {

_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() {
Expand Down
31 changes: 23 additions & 8 deletions src/components/TextInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,24 +194,39 @@ class TextInput extends React.Component<Props, State> {
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() {
Expand Down
3 changes: 3 additions & 0 deletions src/components/Typography/Text.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ type Props = {
class Text extends React.Component<Props> {
_root: NativeText;

/**
* @internal
*/
setNativeProps(...args) {
return this._root.setNativeProps(...args);
}
Expand Down

0 comments on commit 1dbe3e2

Please sign in to comment.