chrisfisher / react-native-directed-scrollview

UNMAINTAINED- see below. A natively implemented scrollview component which lets you specify different scroll directions for child content.
MIT License
149 stars 67 forks source link

Dynamic width and height of content #52

Open Evgenyx82 opened 5 years ago

Evgenyx82 commented 5 years ago

Does it possible use dynamic dimensions of width and height?

  contentContainer: {
    height: 1000,
    width: 1000,
  }
t-kabaya commented 5 years ago

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!