refact common layout (#490)
This commit is contained in:
21
web/app/components/swr-initor.tsx
Normal file
21
web/app/components/swr-initor.tsx
Normal file
@@ -0,0 +1,21 @@
|
||||
'use client'
|
||||
|
||||
import { SWRConfig } from 'swr'
|
||||
import type { ReactNode } from 'react'
|
||||
|
||||
type SwrInitorProps = {
|
||||
children: ReactNode
|
||||
}
|
||||
const SwrInitor = ({
|
||||
children,
|
||||
}: SwrInitorProps) => {
|
||||
return (
|
||||
<SWRConfig value={{
|
||||
shouldRetryOnError: false,
|
||||
}}>
|
||||
{children}
|
||||
</SWRConfig>
|
||||
)
|
||||
}
|
||||
|
||||
export default SwrInitor
|
Reference in New Issue
Block a user