Skip to content
Discussion options

You must be logged in to vote

Woah, I finally saw something: #355 (reply in thread)
It feels a bit confusing but it works 🤷🏼‍♀️

const [initialData, setInitialData] = React.useState(initialAccounts)

React.useEffect(() => {
  setInitialData(undefined)
}, [])

const [timeframe, setTimeframe] = React.useState('foo');
const { data } = useQuery(['accounts', timeframe], api.fetchAccounts, { initialData })

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by kcubero27
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants