1- import { type PortableTextBlock , type PortableTextComponents , PortableText } from '@portabletext/react-latest'
1+ import {
2+ type PortableTextBlock ,
3+ type PortableTextComponents ,
4+ PortableText ,
5+ } from '@portabletext/react'
6+ import { createClient } from '@sanity/client'
27import { studioTheme , ThemeProvider } from '@sanity/ui'
38import { StrictMode , Suspense , use , useEffect , useState } from 'react'
49import { createRoot } from 'react-dom/client'
5- import { createClient } from '@sanity/client'
610
711import { AnnotatedMap } from './components/AnnotatedMap'
812import { CharacterReference } from './components/CharacterReference'
@@ -49,8 +53,17 @@ const ptComponents: PortableTextComponents = {
4953 } ,
5054}
5155
52- const client = createClient ( { projectId : 'ppsg7ml5' , dataset : 'test' , apiVersion : '2025-12-09' , useCdn : true , perspective : 'published' } )
53- const promise = client . fetch < PortableTextBlock [ ] > ( `*[_type == "simpleBlock" && _id == $id][0].body` , { id : '6468a09e-ce29-48d3-8b36-4b058366e6b5' } )
56+ const client = createClient ( {
57+ projectId : 'ppsg7ml5' ,
58+ dataset : 'test' ,
59+ apiVersion : '2025-12-09' ,
60+ useCdn : true ,
61+ perspective : 'published' ,
62+ } )
63+ const promise = client . fetch < PortableTextBlock [ ] > (
64+ `*[_type == "simpleBlock" && _id == $id][0].body` ,
65+ { id : '6468a09e-ce29-48d3-8b36-4b058366e6b5' } ,
66+ )
5467
5568function Demo ( ) {
5669 const blocks = use ( promise )
@@ -62,7 +75,7 @@ function Demo() {
6275 // setCount(count + 100)
6376 return undefined
6477 }
65- const raf = requestAnimationFrame ( ( ) => setCount ( count + 30 ) )
78+ const raf = requestAnimationFrame ( ( ) => setCount ( count + 30 ) )
6679 return ( ) => cancelAnimationFrame ( raf )
6780 } , [ showingEverything , count ] )
6881 return < PortableText value = { blocksToShow } components = { ptComponents } />
0 commit comments