Skip to content

Commit f547bd4

Browse files
authored
add HOC config options to readme
1 parent e0db9f0 commit f547bd4

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,40 @@ import listenToKeyboardEvents from './KeyboardAwareHOC'
156156
export default listenToKeyboardEvents(ListView)
157157
```
158158

159+
The HOC can also be configured. Sometimes it's more convenient to provide a static config than configuring the behavior with props. This HOC config can be overriden with props.
160+
161+
```js
162+
/* @flow */
163+
164+
import { ListView } from 'react-native'
165+
import listenToKeyboardEvents from './KeyboardAwareHOC'
166+
167+
const config = {
168+
enableOnAndroid: true,
169+
enableAutomaticScroll: true,
170+
};
171+
172+
export default listenToKeyboardEvents(config)(ListView)
173+
```
174+
175+
The available config options are:
176+
177+
```js
178+
{
179+
enableOnAndroid: boolean,
180+
contentContainerStyle: ?Object,
181+
enableAutomaticScroll: boolean,
182+
extraHeight: number,
183+
extraScrollHeight: number,
184+
enableResetScrollToCoords: boolean,
185+
keyboardOpeningTime: number,
186+
viewIsInsideTabBar: boolean,
187+
refPropName: string,
188+
extractNativeRef: Function
189+
}
190+
```
191+
192+
159193
## License
160194

161195
MIT.

0 commit comments

Comments
 (0)