mirror of
https://github.com/Afilmory/afilmory
synced 2026-02-01 14:44:48 +00:00
refactor: replace lazy loading feature with domMax in LazyMotion components
- Removed the framer-lazy-feature module and updated LazyMotion components in both landing and dashboard providers to use domMax directly. - This change simplifies the feature loading process and improves performance by eliminating unnecessary imports. Signed-off-by: Innei <tukon479@gmail.com>
This commit is contained in:
@@ -1 +0,0 @@
|
||||
export { domMax as default } from 'motion/react'
|
||||
@@ -1,17 +1,15 @@
|
||||
'use client'
|
||||
|
||||
import { QueryClientProvider } from '@tanstack/react-query'
|
||||
import { LazyMotion } from 'motion/react'
|
||||
import { domMax, LazyMotion } from 'motion/react'
|
||||
import type { JSX, PropsWithChildren } from 'react'
|
||||
|
||||
import { ProviderComposer } from '../../components/common/ProviderComposer'
|
||||
import { queryClient } from '../../lib/query-client'
|
||||
|
||||
const loadFeatures = () =>
|
||||
import('./framer-lazy-feature').then((res) => res.default)
|
||||
const contexts: JSX.Element[] = [
|
||||
<QueryClientProvider key="queryClient" client={queryClient} />,
|
||||
<LazyMotion features={loadFeatures} strict key="framer" />,
|
||||
<LazyMotion features={domMax} strict key="framer" />,
|
||||
]
|
||||
|
||||
export function Providers({ children }: PropsWithChildren) {
|
||||
|
||||
@@ -3,7 +3,7 @@ import { Toaster } from '@afilmory/ui/sonner.jsx'
|
||||
import { Spring } from '@afilmory/utils'
|
||||
import { QueryClientProvider } from '@tanstack/react-query'
|
||||
import { Provider } from 'jotai'
|
||||
import { LazyMotion, MotionConfig } from 'motion/react'
|
||||
import { domMax, LazyMotion, MotionConfig } from 'motion/react'
|
||||
import type { FC, PropsWithChildren } from 'react'
|
||||
|
||||
import { jotaiStore } from '~/lib/jotai'
|
||||
@@ -14,9 +14,8 @@ import { EventProvider } from './event-provider'
|
||||
import { I18nProvider } from './i18n-provider'
|
||||
import { StableRouterProvider } from './stable-router-provider'
|
||||
|
||||
const loadFeatures = () => import('../framer-lazy-feature').then((res) => res.default)
|
||||
export const RootProviders: FC<PropsWithChildren> = ({ children }) => (
|
||||
<LazyMotion features={loadFeatures} strict>
|
||||
<LazyMotion features={domMax} strict>
|
||||
<MotionConfig transition={Spring.presets.smooth}>
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<Provider store={jotaiStore}>
|
||||
|
||||
Reference in New Issue
Block a user