简体   繁体   中英

Please how can I get the first child from an array with is code

I have data that has an array that comes from props. Please how can I render the startdate from the first child of the array? I tried this

  const { event, match } = props;

  const  date = event.eventsession[0].startdate

I am not quite sure but i think you can.I have used it in a similar way passing an Icon prop in a component and remember that capitalization matters in jsx to recognise components you made(thats why all functional components are capitalized).You could also look into the render method of react-dom (ReactDom.render())

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM