When I was using the “three”: “^0.160.0” version, I could change the linear property of the Canvas component in React Three Fiber by toggling a button, which allowed me to enable or disable gamma correction on the canvas.
However, after updating to the “three”: “^0.163.0” version, the linear value is now fixed to the initial value, and changing it programmatically no longer affects the canvas.
Do you know the reason for this behavior? Could it be a conflict between the updated React Three Fiber functionality and the new Three.js version?
const CanvasComponent = ({ children }) => {
const [rgbEnables, setRgbEnables] = useState(false);
return (
<>
<div>
<button
onClick={() => {
setRgbEnables((pre) => !pre);
}}
>
change
</button>
</div>
<Canvas
// flat
linear={rgbEnables}
>
{children}
</Canvas>
</>
);
};
export default CanvasComponent;
i upgrade version drei , fiber please let me know reason why not working