pmndrs / react-three-fiber

🇨🇭 A React renderer for Three.js
https://docs.pmnd.rs/react-three-fiber
MIT License
27.62k stars 1.6k forks source link

`normalScale` is missing `number` as a type #3381

Open verekia opened 1 month ago

verekia commented 1 month ago

normalScale can be used with numbers, it works correctly. But the type doesn't allow numbers:

const Test = () => (
  <mesh>
    <boxGeometry />
    <meshStandardMaterial
      color="red"
      aoMapIntensity={2}
      bumpScale={2}
      roughness={2}
      alphaTest={2}
      lightMapIntensity={2}
      displacementBias={2}
      displacementScale={2}
      normalScale={2}
      ^^^^^^^^^^^^ Type number is not assignable to type Vector2
    />
  </mesh>
)
Type 'number' is not assignable to type 'Vector2'.ts(2322)
MeshStandardMaterial.d.ts(138, 5): The expected type comes from property 'normalScale' which is declared here on type 'ExtendedColors<Overwrite<Partial<MeshStandardMaterial>, NodeProps<MeshStandardMaterial, [MeshStandardMaterialParameters]>>>'
⚠ Error (TS2322)  | 
Type number is not assignable to type Vector2
(property) normalScale?: Vector2 | undefined