Expo xde not using style

#1

When I run following code in the sandbox https://snackexpo.io it works fine. But when I run from the Expo xde I get Invariant Violation: Scrollview child layout must be applied through the contentContainerStyle prop.

import React from 'react';
import { Button, StyleSheet,   ScrollView } from 'react-native';

export default class App extends React.Component {
  blockJS(){
  const done = Date.now() + 5000
  console.log('blocking')
  while(Date.now() < done){done}
  console.log('not blocking')
  }
  render() {
    return (
      <ScrollView style={styles.container}>
        <Button title='Block js' onPress={()=> this.blockJS()}/>
      </ScrollView>
    )
  }
}

const styles = StyleSheet.create({
  container: {
   flex: 1,
    backgroundColor: 'lightblue',
    alignItems: 'center',
    justifyContent: 'center',
  }
})
closed #2

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.