fix: add loading state when no uri is given

This commit is contained in:
Christel Westerberg
2024-02-08 16:04:47 +01:00
parent c0b7f57c8a
commit 86dd453c85
6 changed files with 153 additions and 34 deletions

View File

@@ -1,13 +1,12 @@
"use client";
import ContentstackLivePreview from "@contentstack/live-preview-utils";
import { useEffect } from "react";
import { useEffect } from "react"
import ContentstackLivePreview from "@contentstack/live-preview-utils"
export default function InitLivePreview() {
useEffect(() => {
if (!ContentstackLivePreview.livePreview) {
console.log("INIT");
ContentstackLivePreview.init();
ContentstackLivePreview.init()
}
}, []);