score:0

function MyComponent(props) {
  return <div>{props.hello}</div>;
}


class ParentComponent extends React.Component {
  state = {
    hello: 'Hello World!',
  }

  render() {
    return <MyComponent hello={this.state.hello} />;
  }
}

score:1

function MyComponent (props) {
 // do something with props here
 return <div>Content goes here </div>
}

score:1

const Accordion = props => {

    const { accordionData } = props // pull props from parent component.

    const mapAccordionData = accordionData.map(el => { return <div key={el}>el</div> })

    return mapAccordionData

}

Related Query

More Query from same tag