Refactor Preview.tsx React component to prevent duplicate backend calls

Created on 25 June 2024, 3 days ago
Updated 27 June 2024, 1 day ago

Problem/Motivation

Having multiple Previews currently means that every call to update the src of the iFrame is made once per preview.

Steps to reproduce

Make a change to the layout and observe in the network tab there are multiple calls to /api/preview

Proposed resolution

At this point, inserting a component at a higher level that just deals with fetching the data from the back end seems the best solution. While there, much of the logic where we are injecting/binding events inside the iFrame can probably be tidied too.

🐛 Bug report
Status

Needs review

Component

Page builder

Created by

🇬🇧United Kingdom jessebaker

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024