Skip to content
Discussion options

You must be logged in to vote

render accepts the same render props as canvas, so you can pass frameloop: 'demand' as follows:

import React from 'react'
import { render, events } from '@react-three/fiber'

window.addEventListener('resize', () =>
  render(<mesh />, document.querySelector('canvas'), {
    events,
    size: { width: window.innerWidth, height: window.innerHeight },
    frameloop: 'demand',
  }),
)

window.dispatchEvent(new Event('resize'))

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by TiagoCavalcante
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