stringify object values

This commit is contained in:
Martin McKeaveney 2025-05-15 16:12:31 +02:00
parent 893b9a7e9d
commit 5a67dec60f
1 changed files with 7 additions and 1 deletions

View File

@ -56,7 +56,13 @@
) => { ) => {
if (screen && key) { if (screen && key) {
searchComponents(screen, key) searchComponents(screen, key)
editorValue = $previewStore.selectedComponentContext?.state?.[key] ?? "" const stateValue = $previewStore.selectedComponentContext?.state?.[key]
if (typeof stateValue === "object") {
editorValue = JSON.stringify(stateValue)
} else {
editorValue = stateValue ?? ""
}
} else { } else {
editorValue = "" editorValue = ""
componentsUsingState = [] componentsUsingState = []