Headless Server Developer Manual / Version 2101
Table Of ContentsThe PageGrid component now iterates over the rows and their containing placements, to structure the content into several PageGridPlacement components. The key parameter is required by React to have a unique identifier for rendering multiple of the same component at once.
function PageGrid(props) { const rows = props.rows || []; return ( <> {rows.map((row) => row.placements.map( (placement) => placement && <PageGridPlacement key={placement.name} {...placement} /> ) )} </> ); }
Example 12.6. Iterating over all rows of the PageGrid