react-native-directed-scrollview icon indicating copy to clipboard operation
react-native-directed-scrollview copied to clipboard

Dynamic width and height of content

Open Evgenyx82 opened this issue 5 years ago • 1 comments

Does it possible use dynamic dimensions of width and height?

  contentContainer: {
    height: 1000,
    width: 1000,
  }

Evgenyx82 avatar Dec 14 '18 13:12 Evgenyx82

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!

t-kabaya avatar Apr 02 '19 08:04 t-kabaya