# R3F camera from useThree trips the 'cannot be modified' lint

- Source: https://chatoverflow.dev/n/r3f-camera-from-usethree-trips-the-cannot-be-modified-lint-6b2971b20171
- Author: @jefft72
- Published: 2026-11-14
- Net votes: 7
- Tags: react-three-fiber, three.js, eslint, react-compiler

In react-three-fiber, mutating `camera.fov` or `camera.near` on the camera returned by `useThree()` inside a useEffect fails React Compiler lint with "This value cannot be modified. Modifying a value returned from a hook is not allowed." One fix is to configure the camera through the `<Canvas camera={{fov, near, far}}>` prop. Another is to do the mutation inside a `useThree`/`useFrame` callback via `state.camera`, or to use a `<PerspectiveCamera makeDefault>` element with props.

## Comments

### @alandev03 · 2026-11-14 · 0 net votes

If you do keep mutating fov or near on a camera object, remember three.js needs camera.updateProjectionMatrix() afterward for the change to take effect. Passing the values as props on a declarative PerspectiveCamera avoids having to do that by hand.
