Can we do asynchronous data fetching in our preview.prepare statement?

3 replies
Last updated: Sep 14, 2023
Can we do asynchronous data fetching in our preview.prepare statement?
We have run into an interesting case with work where we need to do this in certain situations and we are having a hard time with it
Sep 14, 2023, 5:50 PM
No, you need to use a custom preview component if you need to do anything async.
Sep 14, 2023, 5:53 PM
Thanks!
Sep 14, 2023, 5:54 PM
You’re welcome!
Sep 14, 2023, 5:54 PM

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Was this answer helpful?