Headless Server Developer Manual / Version 2307
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 14.6. Iterating over all rows of the PageGrid