Skip to content

Typescript Error with Geometry props #3504

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Thangouliou opened this issue Mar 22, 2025 · 4 comments
Open

Typescript Error with Geometry props #3504

Thangouliou opened this issue Mar 22, 2025 · 4 comments

Comments

@Thangouliou
Copy link

👋 hi there, for issues that aren't that pressing, that could be related to threejs etc, please consider github discussions.

TypeScript Error with boxGeometry props

I'm getting TypeScript errors when trying to use boxGeometry component:

<boxGeometry args={[1, 1, 1]} />

Error:

Using React Native with Expo and TypeScript.
Package versions:

  • @react-three/fiber: ^9.1.0
  • three: ^0.174.0
  • typescript: ^5.3.3

Could you please help with the correct type definitions for the boxGeometry component?

can you help me??

@mordv
Copy link
Contributor

mordv commented Mar 23, 2025

Is it typescript or eslint error in your case?
Now I'm getting ESLint: Unknown property 'intensity' found(react/no-unknown-property) for all the props, but it compiles ok.

"eslint": "^8.41.0",

@Thangouliou
Copy link
Author

I'm facing the same problem with ESLint error "Unknown property 'args' found".

I tried changing:

<boxGeometry args={[1, 1, 1]} />

to:

<boxGeometry primitive={[1, 1, 1]} />

But the problem persists. The suggested solution is to add the following ESLint rule to .eslintrc.js:

"react/no-unknown-property": ["error", { 
ignore: ["args", "intensity", "position", "rotation", "scale"] 
}]

Is there a better solution for this problem? args seems to be the correct property according to the Three.js documentation.

@krispya
Copy link
Member

krispya commented Mar 24, 2025

Hello, to help out I need to know a little more info.

  1. What is the TypeScript error you are getting exactly?
  2. For ESLint, I need to be able to reproduce the issue. Is there a minimal reproduction? When doing a vite install, ESLint works for me.

@pjh714332048
Copy link

I didn't get the TS error. But I got the same eslint error.

ERROR(ESLint) Unknown property 'map' found (react/no-unknown-property)

<mesh> <planeGeometry args={[width || texture?.image?.width, height || texture?.image?.height]} /> <meshStandardMaterial map={texture} /> </mesh>
My eslint version is 9.21.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants