It can't find any reason why this wouldn't work. I have watched all tutorials doing the same. Any one have an idea?
Asked
Active
Viewed 58 times
2 Answers
0
there is an extra braces in the query.
Write this:
const query = `*[_type == "courses"]{
title
}`;
sanityClient.fetch(query)
.then(data=>setCourses(data))
0
Cannot thank you enough..just braces caused me 2 days..even tried another headless CMS..XD

Anurag
- 11
- 1