Skip to content

Correct Way to Integrate Motion and Lenis with React 18.3.1 in Vite? #2913

Closed Answered by DavidAyoa
DavidAyoa asked this question in Q&A
Discussion options

You must be logged in to vote

You're absolutely right! However, in my case, this approach worked perfectly. You can see it live on my portfolio (which is still in progress) at dayoa.vercel.app.

Here's the relevant code:

import './App.css'
import { useEffect, useRef, useState } from 'react'
import { LenisRef, ReactLenis } from 'lenis/react'
import { cancelFrame, frame } from "motion/react"
import Preloader from './components/Preloader'
import Navigation from './components/Navigation'
import Intro from './components/Intro'
import FrontendHero from './components/FrontendHero'
import Footer from './components/Footer'
// import BackendHero from './components/BackendHero'
// import About from './components/About'

interface F…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by DavidAyoa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants