Skip to content

useSource is marked as depreciated #3335

Discussion options

You must be logged in to vote

Thanks for reporting, @joshuaellis! Looks like we'll have to update our documentation. Could you try using these hooks instead of useSource()?

// new hooks
import {
  useClient,
  useDataset,
  useProjectId,
  useSchema,
  useTemplates,
  useTools,
} from 'sanity'

const client = useClient({apiVersion: '2022-05-01'})
const dataset = useDataset()
const projectId = useProjectId()
const schema = useSchema()
const templates = useTemplates()
const tools = useTools()

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@joshuaellis
Comment options

joshuaellis Jun 14, 2022
Collaborator Author

Answer selected by joshuaellis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants