react-three-fiber icon indicating copy to clipboard operation
react-three-fiber copied to clipboard

Error in test renderer when calling update

Open JakeCoxon opened this issue 2 years ago • 0 comments

https://codesandbox.io/s/gracious-blackwell-yuleq6?file=/app.test.js

Using the box from the examples

import ReactThreeTestRenderer from '@react-three/test-renderer'
import { Box } from './src/App'

it('Test', async () => {
  const threeRenderer = await ReactThreeTestRenderer.create(<Box />)

  await threeRenderer.update(<Box />)
})

Tested in version 7 and 8. When using update it seems that it can't find the context provider. Weirdly the initial create works fine

'R3F hooks can only be used within the Canvas component!'

JakeCoxon avatar Apr 08 '22 14:04 JakeCoxon