Keep getting above error, i've looked at other solutions but they don't seem to be working. Would appreciate some insight on what im missing. I read a getter needs a setter but im not sure how i would even include that in a basic fetch call.
I am using react and trying to fetch a blog post from contentful.
My code is below
import React from 'react'
import { useState, useEffect } from 'react'
import { createClient } from 'contentful'
const client = createClient=({
space:"xxxxxxxxx",
access_token:"xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
})
function App() {
const [blog, setBlog] = useState([])
useEffect=(()=> {
const BlogPosts = async () => {
try{
await client.getEntries().then((entries)=> {
console.log(entries);
setBlog(entries)
})
} catch (err){
console.log(err)
}
}
BlogPosts()
}, [])
return (
<div>App</div>
)
}
export default App