Skip to content

Commit

Permalink
use KeyboardAwareScrollView in examples to ensure compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
slorber committed Feb 4, 2019
1 parent 343b782 commit ddecc99
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions example/components/Components.tsx
Expand Up @@ -3,11 +3,12 @@ import {
Text,
View,
TouchableOpacity,
ScrollView,
Keyboard,
ViewProps, GestureResponderEvent,
ViewProps,
GestureResponderEvent,
} from 'react-native';
import { ScrollIntoView, wrapScrollView } from 'scrollIntoView';
import { ScrollIntoView, wrapScrollViewConfigured } from 'scrollIntoView';
import { KeyboardAwareScrollView } from 'react-native-keyboard-aware-scroll-view';
import { isFunction } from 'lodash';

export const dismissKeyboardWhenCalled = (
Expand Down Expand Up @@ -48,14 +49,16 @@ export const Button = ({
</TouchableOpacity>
);

export const Centered = ({ style, ...props }: ViewProps & {children?: ReactNode}) => (
export const Centered = ({
style,
...props
}: ViewProps & { children?: ReactNode }) => (
<View
style={[{ alignItems: 'center', justifyContent: 'center' }, style]}
{...props}
/>
);

export const ScrollIntoViewScrollView = wrapScrollView(ScrollView);
ScrollIntoViewScrollView.defaultProps = {
keyboardShouldPersistTaps: 'handled',
};
export const ScrollIntoViewScrollView = wrapScrollViewConfigured({
refPropName: 'innerRef',
})(KeyboardAwareScrollView);

0 comments on commit ddecc99

Please sign in to comment.