How to render an array of JSX elements (React components)
问题 I'm trying to render an array of named react components, say <Foo /> , <Bar /> , and <Baz /> ,for example. const rendered = []; const getItems = this.props.itemslist.map((item, key) => { const TYPE = item.type; rendered.push(<TYPE data-attributes={attributes} key={key} />); }); return ( <Grid> <Row> {rendered} </Row> </Grid> ); I can iterate over my array and see in the console the array of elements, but they are rendered as empty html elements " <foo></foo><bar></bar><baz></baz> ", and not