From 980b104f79915fb39bc523a7239020695e26640a Mon Sep 17 00:00:00 2001 From: pgiki Date: Sun, 3 Apr 2022 09:33:17 +0300 Subject: [PATCH] Removed width and height as Page props because they can be passed as containerStyles --- src/Page.js | 6 +----- src/index.js | 8 ++------ 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/src/Page.js b/src/Page.js index 16517c7..dda2b3f 100644 --- a/src/Page.js +++ b/src/Page.js @@ -7,8 +7,6 @@ const Page = ({ image, title, subtitle, - width, - height, containerStyles, imageContainerStyles, allowFontScaling, @@ -38,7 +36,7 @@ const Page = ({ } return ( - + {image} {titleElement} {subtitleElement} @@ -65,8 +63,6 @@ Page.propTypes = { subTitleStyles: PropTypes.shape({ style: PropTypes.any, }), - width: PropTypes.number.isRequired, - height: PropTypes.number.isRequired, }; Page.defaultProps = { diff --git a/src/index.js b/src/index.js index ad23272..0d64701 100755 --- a/src/index.js +++ b/src/index.js @@ -29,8 +29,6 @@ class Onboarding extends Component { this.state = { currentPage: 0, previousPage: null, - width: null, - height: null, backgroundColorAnim: new Animated.Value(0), }; } @@ -76,8 +74,8 @@ class Onboarding extends Component { }; _onLayout = () => { - const { width, height } = Dimensions.get('window'); - this.setState({ width, height }); + // const { width, height } = Dimensions.get('window'); + // this.setState({ width, height }); }; keyExtractor = (item, index) => index.toString(); @@ -99,8 +97,6 @@ class Onboarding extends Component { image={image} title={title} subtitle={subtitle} - width={this.state.width || Dimensions.get('window').width} - height={this.state.height || Dimensions.get('window').height} containerStyles={containerStyles} imageContainerStyles={imageContainerStyles} allowFontScaling={allowFontScalingText}