By dispatching the 'hydrationDone' event after complete hydration of the preview is completed, we've effectively eliminated this source of contention.
Users can add an event listener on the hydrationDone
event and execute their following code. This is especially useful if they are trying to manipulate DOM content.
Add a code element in the builder
Listen the hydrationDone
event like below
Once the preview DOM content is loaded and hydration event is received, the custom code will run without any issue or race condition.