-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Preview feature doesn't work outside of presentation mode using @sanity/react-loader #949
Comments
I'm having the same issue. The presentation mode is great, but not always ideal and also more complex to implement. I'd love to know if this is a bug, or if |
Same issue here! Has anyone found a workaround at all? |
@fdoflorenzano not yet, I tried to investigate but when we use react-loaders with sanity-preview the websock connection that listens for changes in sanity content is not enabled, so the useLiveQuery data is not refreshed then the component is not re-rendered - I suspect that is something that the |
Any updates on this? Is react/loader, presentation mode not compatible with the preview use Iframe pane? |
I'm curious about this too, and I'm considering using both of these, differentiating between which one is used based on how it is presented. That seems like a bunch of extra work for me that really should be possible out of the box though. |
Still no fix for this? Any news? |
Describe the bug
When using a preview setup using
sanity-plugin-iframe-pane
and@sanity/react-loader
the data doesn't get automatically refreshed like it used to work before, It only works when using presentation view.When we enable the hook that set up the connection with sanity and listen for changes using
useLiveMode
the connection never happens, so all theuseQuery()
hooks doesn't get the data automatically refreshed when user make changes.It works fine when we use the old package
import { useLiveQuery } from 'next-sanity/preview';
The presentation mode is great, therefore are still relevant use cases to use the old preview feature supported by the sanity-plugin-frame` that allow users to navigate through content easier, so we would like to leave this option enabled.
I had a look in the source code and realised that the connection implemented on
packages/core-loader/src/live-mode/enableLiveMode.ts
only happens when we open the presentation window in sanity CMS.There is an existent issue reported on sanity-io/sanity-plugin-iframe-pane#102 apparently describes the same issue.
Will it be possible to use
@sanity/react-loader
together with the standard preview feature previously recommended by Sanity CMS without the presentation mode enabled?To Reproduce
sanity-plugin-iframe-pane
(the recommended way by sanity)@sanity/react-loader
, call theuseLiveMode()
hook and implement preview features using theuseQuery
client hook.Expected behavior
I would expect for the content to be automatically refreshed in the presentation view in the iframe like it used to work before with the
import { useLiveQuery } from 'next-sanity/preview';
Screenshots
Which versions of Sanity are you using?
What operating system are you using?
macOs Sonoma 14.11
Which versions of Node.js / npm are you running?
The text was updated successfully, but these errors were encountered: