The types declare that the callback receives the same type that's returned from the hook itself. However, that's not the case, and it will never receive a record object.
Relevant code:
const returnedTextures = useTexture(
{map: 'color.jpg', normalMap: 'normal.png'},
(callbackTextures) => {
// callbackTextures can never be an object here, and always produces and
// array, as opposed to returnedTextures, which correctly adheres to the
// declared type.
},
);
Suggested solution:
Fix the callback to adhere to the declared type. I will provide a PR for this.
three
version: 0.164.1@react-three/fiber
version: 8.16.6@react-three/drei
version: 9.105.6node
version: v22.2.0npm
(oryarn
) version: 1.22.22Problem description:
The types declare that the callback receives the same type that's returned from the hook itself. However, that's not the case, and it will never receive a record object.
Relevant code:
Suggested solution:
Fix the callback to adhere to the declared type. I will provide a PR for this.