networkMode 제거
@suspensive/react-query v2 & @tanstack/react-query@4에서 @suspensive/react-query v3로 업데이트하는 경우 추천합니다.
@suspensive/react-query v3에서는 Suspense API에서 networkMode를 ‘always’로 고정하고 수정할 수 없습니다.
해당 Codemod가 도움이 될 수 있는 v3 브레이킹 체인지에 대해 자세한 내용은 v3로 마이그레이션하기에서 확인할 수 있습니다.
Terminal
npx @suspensive/codemods remove-networkmode .Suspense API에서 제거가 필요한 networkMode를 쉽고 안전하게 제거할 수 있습니다.
예:
import { queryOptions } from '@tanstack/react-query'
const options = queryOptions({
queryKey: ['key'],
queryFn: () => Promise.resolve('data'),
networkMode: 'always',
})변환 후:
import { queryOptions } from '@tanstack/react-query'
const options = queryOptions({
queryKey: ['key'],
queryFn: () => Promise.resolve('data'),
})수정된 날짜: