gatsby-wordpress-search
gatsby-wordpress-search copied to clipboard
Maximum update depth exceeded.
Hi! I tried to set up your plugin but i encountered some issues. It happens when as soon as the page loads where the component is present.
This is the error i receive:
Warning: Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render. in SearchComponent (at HeaderSearchbar.tsx:10) in StaticQueryDataRenderer (at gatsby-browser-entry.js:38)
And this is my current setup:
import React from 'react'
import { StaticQuery, graphql, navigate } from 'gatsby'
import Search from 'gatsby-wordpress-search'
const HeaderSearchbar = () => (
<StaticQuery
query={graphql`
{
allWordpressWpSearchResults {
edges {
node {
id
post_title
searchData
pathname
}
}
}
}
`}
render={data => {
return (
<Search
data={data}
minCharacters={4}
contentCharacters={300}
maxResults={10}
placeholder="Search"
onSelect={object => navigate(o.pathname)}
/>
)
}}
/>
)
export default HeaderSearchbar
Any ideas of what could be causing this issue?
Same problem. Repo is probably dead. Decided to create my own instead.