Hello! I’m using Advanced Custom Fields with a Frontity Project and since it’s more component driven, I’m using the Flexible Content field to render some components so that users can re-arrange components as needed or have multiples of components. I did this in PHP with this loop:
<?php if (have_rows('content_blocks')) : while (have_rows('content_blocks')) : $row = the_row(); $layout = get_row_layout(); get_template_part('custom/components/' . $layout); endwhile; endif; ?>
I’m wondering what the best approach would be in React + Frontity?
Ideally I’d have a sort of component router that would take each layout within a Flexible Content block on a page, and then render that partial. I’m not super familiar with how to handle this within React! Any help would be appreciated!