React Native
  • Initial page
  • Set-up
    • Prepare the environment
    • ESLint
    • Debugger
  • Introduction
    • React v.s. React Native
    • Project Tree & Script Structure
  • Component & Props
    • What is Props
    • What is Compoent
      • Axios and Component State
      • Class-base components
      • Example
        • Activity Indicator
        • Rendering Large list
        • Card
  • Styling
    • What is Styling
    • Primitive elements
    • Flexbox
      • justifyContent
      • flexDirection
    • More on styling
    • Alignment & Touchable Item
  • Redux
    • What is Redux
    • What is Reducer
  • React-thunk
    • Untitled
  • Build & Release
    • Untitled
Powered by GitBook
On this page

Was this helpful?

  1. Component & Props
  2. What is Compoent
  3. Example

Card

PreviousRendering Large listNextWhat is Styling

Last updated 6 years ago

Was this helpful?

props.children

  • Will show up the item that wrap in the tag, e.g.

const AlarmDetail =  (props) => {
  return (
    <Card>
        <Text>{"Danny is handsome"}</Text>
    </Card>
  );
};

const Card = (props) => {
    return (
        <View style={styles.containerStyle}>{props.children}</View>
    );
};