Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/Page.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ const Page = ({
image,
title,
subtitle,
width,
height,
containerStyles,
imageContainerStyles,
allowFontScaling,
Expand Down Expand Up @@ -38,7 +36,7 @@ const Page = ({
}

return (
<View style={[styles.container, containerStyles, { width, height }]}>
<View style={[styles.container, containerStyles]}>
<View style={[styles.imageContainer, imageContainerStyles]}>{image}</View>
{titleElement}
{subtitleElement}
Expand All @@ -65,8 +63,6 @@ Page.propTypes = {
subTitleStyles: PropTypes.shape({
style: PropTypes.any,
}),
width: PropTypes.number.isRequired,
height: PropTypes.number.isRequired,
};

Page.defaultProps = {
Expand Down
8 changes: 2 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ class Onboarding extends Component {
this.state = {
currentPage: 0,
previousPage: null,
width: null,
height: null,
backgroundColorAnim: new Animated.Value(0),
};
}
Expand Down Expand Up @@ -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();
Expand All @@ -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}
Expand Down