Open HenrikSZ opened 1 month ago
Remove redux and redux toolkit dependencies. Instead use tanstack react-query.
See the overview here: https://tanstack.com/query/latest/docs/framework/react/overview
You can usually create the query hooks like this:
const useEventQuery = () => useQuery({ queryKey: ['eventsData'], queryFn: () => { try { return await fetchHelper({ base: 'CMS', url, }); } catch (error) { console.log(error); throw error; } } })
This also includes removing the context / useApi.
Remove redux and redux toolkit dependencies. Instead use tanstack react-query.
See the overview here: https://tanstack.com/query/latest/docs/framework/react/overview
You can usually create the query hooks like this:
This also includes removing the context / useApi.