Dan Glodeanu
Dan Glodeanu

Reputation: 25

Adding three.js to react-three-fiber

Can someone tell me how I can combine three.js code with react-three-fiber? I saw that tag is useful in such cases but still can't understand how.

Upvotes: 0

Views: 398

Answers (1)

Epiczzor
Epiczzor

Reputation: 427

Import Three to use related stuff, like this

import * as THREE from 'three'

Then you can access THREE stuff such as THREE.Vector3

ideally you would want to write your three code in a hook like useEffec or useFrame or in any another way whichever is relevant.

Upvotes: 1

Related Questions