From ee35a78118d2df2936e59ecaccb7446b0acc3d09 Mon Sep 17 00:00:00 2001 From: FabriceMisyl <54837812+FabriceMisyl@users.noreply.github.com> Date: Fri, 20 Sep 2019 19:07:33 +0200 Subject: [PATCH] Update Readme.md to better understand --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e15f8dd..0593444 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Import `react-native-keyboard-aware-scroll-view` and wrap your content inside it: ```js -import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view' +import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view'; ``` ```jsx @@ -62,11 +62,18 @@ As of `v0.1.0`, the component auto scrolls to the focused `TextInput` 😎. For In order to scroll to any `TextInput` field, you can use the built-in method `scrollToFocusedInput`. Example: +```js +import { findNodeHandle } from 'react-native'; +``` + ```js _scrollToInput (reactNode: any) { // Add a 'scroll' ref to your ScrollView this.scroll.props.scrollToFocusedInput(reactNode) } + +render() { +... ``` ```jsx @@ -78,7 +85,7 @@ _scrollToInput (reactNode: any) { { // `bind` the function if you're using ES6 classes - this._scrollToInput(ReactNative.findNodeHandle(event.target)) + this._scrollToInput(findNodeHandle(event.target)) }} />