Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting fullHeight prop to true throws error on resize #5

Open
justintemps opened this issue Nov 22, 2018 · 1 comment
Open

Setting fullHeight prop to true throws error on resize #5

justintemps opened this issue Nov 22, 2018 · 1 comment

Comments

@justintemps
Copy link
Contributor

The problem is this line.

Setting fullHeight to true in <ParallaxMousemove /> attempts to set this.props.containerStyle.height to the height of the window. But that won't work, props are read-only in React.

@Drevar0
Copy link
Contributor

Drevar0 commented Nov 8, 2020

resolved,
you must add an try catch ah the line 25 of src/lib/index.js.
from:
this.props.containerStyle.height = window.innerHeight

to:
try {
this.props.containerStyle.height = window.innerHeight;
} catch (error) {}

You can't know if a variable is read only, this metod is heavy but stable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants