swr-initor.tsx 333 B

123456789101112131415161718192021
  1. 'use client'
  2. import { SWRConfig } from 'swr'
  3. import type { ReactNode } from 'react'
  4. type SwrInitorProps = {
  5. children: ReactNode
  6. }
  7. const SwrInitor = ({
  8. children,
  9. }: SwrInitorProps) => {
  10. return (
  11. <SWRConfig value={{
  12. shouldRetryOnError: false,
  13. }}>
  14. {children}
  15. </SWRConfig>
  16. )
  17. }
  18. export default SwrInitor