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

Dynamic width and height of content #52

Open
Evgenyx82 opened this issue Dec 14, 2018 · 1 comment
Open

Dynamic width and height of content #52

Evgenyx82 opened this issue Dec 14, 2018 · 1 comment

Comments

@Evgenyx82
Copy link

Does it possible use dynamic dimensions of width and height?

  contentContainer: {
    height: 1000,
    width: 1000,
  }
@t-kabaya
Copy link

t-kabaya commented Apr 2, 2019

setState solve this.
You should write setState directly in componentDidMount or componentWillMount

componenDidMount = () => {
  this.setState({width: 500})
}

...

contentCntanierStyle={styles.contentContainer(this.state.width)}

...

const styles = StyleSheet.create({
  contentContainer: (width) => ({
    height: 1000,
    width: width
  })
})

try!

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