Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IS-2892: Upgrade react query #598

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

andersrognstad
Copy link
Contributor

Hva har blitt lagt til✨🌈

Oppgraderer react-query til v5

@andersrognstad andersrognstad requested a review from a team as a code owner February 17, 2025 09:37
@@ -69,15 +69,15 @@ export const usePersonoversiktQuery = () => {
queryFn: fetchPersonoversikt,
enabled: !!aktivEnhet,
staleTime: minutesToMillis(5),
onError: (error) => {
Copy link
Contributor Author

@andersrognstad andersrognstad Feb 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Disse query-callbackene er deprecated i v5 (finnes fortsatt for mutations).
Denne måten å gjøre det på med å definere callbacks på query.meta-objektet som brukes der hvor queryClient settes opp er beskrevet her.

import ErrorBoundary from '@/components/error/ErrorBoundary';
import { initFaro } from '@/faro';
import { isLocal } from '@/utils/miljoUtil';

const queryClient = new QueryClient({
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Flyttet dette ut i egen fil og la på onError / onSuccess-håndtering

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant