Skip to content

Commit b66e5f6

Browse files
committed
README: add docs about ref methods, also add Todos section
1 parent 3a4d991 commit b66e5f6

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

README.md

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ import ReactDOM from 'react-dom'
1212

1313
ReactDOM.render(
1414
<InputHints
15-
waitBeforeDeleteMs={2000}
16-
writeSpeedMs={100}
17-
deleteSpeedMs={60}
1815
placeholders={[
1916
'Enter your username here...',
2017
'Usernames can be 7-18 characters long.',
@@ -23,6 +20,18 @@ ReactDOM.render(
2320
)
2421
```
2522

23+
## Component's ref API
24+
25+
The component implements an API that makes it possible to interact with the DOM node itself. Use [`ref`](https://facebook.github.io/react/docs/refs-and-the-dom.html)s to access these methods.
26+
27+
### `focus()`
28+
29+
Brings focus on the input element.
30+
31+
### `blur()`
32+
33+
Removes focus from the input element.
34+
2635
## Installation
2736

2837
```sh
@@ -52,6 +61,10 @@ Same as `writeSpeedMs` (see above), but for when deleting characters.
5261

5362
Use the [`selector:placeholder`](http://css-tricks.com/snippets/css/style-placeholder-text/) CSS pseudo-class to style your placeholders!
5463

64+
## Todos
65+
66+
- Make it support arbitrary components via props.
67+
5568
## License
5669

5770
Licensed under the MIT license.

0 commit comments

Comments
 (0)