Skip to content

Commit 7def173

Browse files
author
William Porto
committed
chore(components): adding deprecation warning to KeyboardAwareScrollView
1 parent b5543fb commit 7def173

File tree

6 files changed

+20
-17
lines changed

6 files changed

+20
-17
lines changed

template/src/components/KeyboardAwareScrollView/KeyboardAwareScrollView.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ interface KeyboardAwareScrollViewComponentProps extends KeyboardAwareScrollViewP
88
children: ReactNode;
99
}
1010

11+
/**
12+
* @deprecated https://github.com/APSL/react-native-keyboard-aware-scroll-view/issues/494#issuecomment-900089166
13+
*/
1114
const KeyboardAwareScrollViewComponent: FC<KeyboardAwareScrollViewComponentProps> = ({
1215
children,
1316
...rest

template/src/screens/Form/Form.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import React, { FC, useRef, MutableRefObject, useState } from 'react';
2+
import { ScrollView } from 'react-native';
23
import { useForm, Controller } from 'react-hook-form';
34
import { yupResolver } from '@hookform/resolvers/yup';
45

5-
import { Column, Input, InputRef, Button, KeyboardAwareScrollView } from 'src/components';
6+
import { Column, Input, InputRef, Button } from 'src/components';
67

78
import { FormExampleSchema } from 'src/utils';
8-
import { padding } from 'styled-system';
99

1010
interface FormExampleData {
1111
email: string;
@@ -41,7 +41,7 @@ const Form: FC = () => {
4141

4242
return (
4343
<Column flex={1}>
44-
<KeyboardAwareScrollView
44+
<ScrollView
4545
contentContainerStyle={{
4646
flex: 1,
4747
justifyContent: 'center',
@@ -87,7 +87,7 @@ const Form: FC = () => {
8787
<Button text='Submit form' onPress={handleSubmit(onSubmit)} mt={20} />
8888

8989
<Button variant='secondary' text='Reset form' onPress={() => reset()} />
90-
</KeyboardAwareScrollView>
90+
</ScrollView>
9191
</Column>
9292
);
9393
};

template/storybook/stories/Button/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ export default function Button({ onPress, children }) {
88

99
Button.defaultProps = {
1010
children: null,
11-
onPress: () => {},
11+
onPress: () => {}
1212
};
1313

1414
Button.propTypes = {
1515
children: PropTypes.node,
16-
onPress: PropTypes.func,
16+
onPress: PropTypes.func
1717
};

template/storybook/stories/CenterView/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ export default function CenterView({ children }) {
88
}
99

1010
CenterView.defaultProps = {
11-
children: null,
11+
children: null
1212
};
1313

1414
CenterView.propTypes = {
15-
children: PropTypes.node,
15+
children: PropTypes.node
1616
};

template/storybook/stories/CenterView/style.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ export default {
33
flex: 1,
44
justifyContent: 'center',
55
alignItems: 'center',
6-
backgroundColor: '#F5FCFF',
7-
},
6+
backgroundColor: '#F5FCFF'
7+
}
88
};

template/storybook/stories/Welcome/index.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,20 @@ export default class Welcome extends React.Component {
77
wrapper: {
88
flex: 1,
99
padding: 24,
10-
justifyContent: 'center',
10+
justifyContent: 'center'
1111
},
1212
header: {
1313
fontSize: 18,
14-
marginBottom: 18,
14+
marginBottom: 18
1515
},
1616
content: {
1717
fontSize: 12,
1818
marginBottom: 10,
19-
lineHeight: 18,
20-
},
19+
lineHeight: 18
20+
}
2121
};
2222

23-
showApp = (event) => {
23+
showApp = event => {
2424
const { showApp } = this.props;
2525
event.preventDefault();
2626

@@ -49,9 +49,9 @@ export default class Welcome extends React.Component {
4949
}
5050

5151
Welcome.defaultProps = {
52-
showApp: null,
52+
showApp: null
5353
};
5454

5555
Welcome.propTypes = {
56-
showApp: PropTypes.func,
56+
showApp: PropTypes.func
5757
};

0 commit comments

Comments
 (0)