React:Props & Children

Props

import React from 'react';

const person = (props)=>{
  return(
    <div>
    <p>I Am a person!</p>
    <p>{props.name}</p>
    <p>i'm {props.age}</p>
  <p>{props.children}</p>
    </div>
  )
};

export default person;

Children为< Person> < / Person>中的内容;

      <Person name="manue" age="26">My Hobbies: Racing</Person>

你可能感兴趣的:(React)