Skip to content

Commit

Permalink
fix type errors in the example (#426)
Browse files Browse the repository at this point in the history
  • Loading branch information
rezathematic authored Jan 9, 2025
1 parent d3f316a commit 4b722ad
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,15 +107,17 @@ function Component() {
### Framer Motion integration:
```jsx
import { ReactLenis } from 'lenis/react'
import { ReactLenis } from 'lenis/react';
import type { LenisRef } from 'lenis/react';
import { cancelFrame, frame } from 'framer-motion';
import { useEffect, useRef } from 'react';

function Component() {
const lenisRef = useRef()
const lenisRef = useRef<LenisRef>(null)

useEffect(() => {
function update(time) {
function update(data: { timestamp: number }) {
const time = data.timestamp
lenisRef.current?.lenis?.raf(time)
}

Expand Down

0 comments on commit 4b722ad

Please sign in to comment.