kukab
kukab

Reputation: 571

expo constants is not working in react native

for statusbar instead of using platform I used expo constant it was working fine suddenly I decided to make expo component and style it,

export default function ExpoScreen({ Children }) {
  return <SafeAreaView style={styles.screen}>{Children}</SafeAreaView>;
}

const styles = StyleSheet.create({
  screen: {
    paddingTop: Constants.statusBarHeight,
  },
});

this is my savescreen where I import expoScreen component but it gives no result it gives a white screen with out any error

export default function MessageScreen() {
  return (
    <ExpoScreen>
      <FlatList
        data={messages}
        keyExtractor={(message) => message.id.toString()}
        renderItem={({ item }) => (
          <ListItem
            title={item.title}
            sutitle={item.description}
            image={item.image}
          />
        )}
      />
    </ExpoScreen>
  );
}

enter image description here

Upvotes: 0

Views: 444

Answers (1)

Guruparan Giritharan
Guruparan Giritharan

Reputation: 16354

You are using Children instead of children change it to

function ExpoScreen({ children }) {
  return <SafeAreaView style={styles.screen}>{children}</SafeAreaView>;
}

Upvotes: 1

Related Questions