Skip to content

Latest commit

 

History

History
30 lines (22 loc) · 433 Bytes

README.md

File metadata and controls

30 lines (22 loc) · 433 Bytes

Tempus/react

Basic Usage

import { useTempus } from 'tempus/react'

function App() {  
  useTempus((time, deltaTime) => {
    console.log('frame', time, deltaTime)
  })
}

Options

useTempus(() => {}, { 
  fps: 30, // Will run at 30 FPS
  priority: -1, // Will run before other animations
})

Patching requestAnimationFrame

import { ReactTempus } from 'tempus/react'

<ReactTempus patch />