I have a api with rtk (redux-toolkit) with a state 'search'
const [search, setSearch] = useState({nexToken: null})
const { data, isLoading, isError } = useGetPostQuery(search ?? skipToken)
useEffect(() => {
console.log('data', data)
}, [data])
When I call methods to add parameters to my search and set the new state does not happen again the api, why?
for example:
const addCity = () => {
const newFilter = { city: 'London. }
setSearch({...search, ...newFilter})
}