I'm developing site with Gatsby and Prismic. I am implementing prismic preview with prismic-javascript. When click the preview on prismic, gatsby redirecting it to the proper URL but updated content not displaying now.
I tried to use the gatsby-source-prismic-preview plugin but it not worked.
const Preview = ({ history, location }) => {
useEffect(() => {
const params = qs.parse(location.search.slice(1))
if (!params.token) {
return console.warn(`No token available, check your configuration`)
}
client.previewSession(params.token, linkResolver, '/')
.then(url => {
navigate(url);
})
.catch(err => console.log(err))
})
return null
}
This is my preview page.
Please let me what is my mistake.