3 ms·
You can use either SWR[0] or React Query[1] hooks to write a query to fetch data for the first component and whenever you make a post request from the second co
by plastic_bag 5y ago
You can use either SWR[0] or React Query[1] hooks to write a query to fetch data for the first component and whenever you make a post request from the second component, you call the mutation function to revalidate the first component's data and replace it.
[0]https://swr.vercel.app/docs/mutation https://swr.vercel.app/docs/mutation
[1]https://react-query.tanstack.com/guides/mutations https://react-query.tanstack.com/guides/mutations