react-three-renderer-fiber
react-three-renderer-fiber copied to clipboard
Warning about possible conflicts in JSX.IntrinsicElements
Hi @toxicFork, I cloned react-three-renderer-fibre, opened the project in IDEA and... it all looks great!
I can see you are adding intrinsic elements to the global JSX.IntrinsicElements. I just want to make you aware that you may run into issues with conflicts with existing elements defined by React. A basic example would be line
which is also an SVG element.
It may be that the only option is to make sure the R3R element names don't clash, but then this would not be backwards compatible with existing R3R.
I think this is a basic Typescript limitation right now and I raised this issue for the Typescript team: https://github.com/Microsoft/TypeScript/issues/15266.
Something to think about...
Hi @jugglingcats thank you for taking a look and doing some research and creating the issue!
I'll check if I can help by adding comments into the issue you have just linked which may help them to answer some questions they have raised :)
I'm sure you are much more qualified to move that discussion forward! :)
This is not a warning for me but an error:
20190820T093944 E1258170@noosl-0r018:~/d/pdgm.com/az.dev/EP-Connect/property-model-update.roxar
$ tsc --outdir /var/tmp/ts-dist/
node_modules/react-three-fiber/types/src/three-types.d.ts:64:7 - error TS2717: Subsequent property declarations must have the same type. Property 'audio' must be of type 'DetailedHTMLProps<AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>', but here has type 'Object3DNode<Audio, typeof Audio>'.
64 audio: ReactThreeFiber.Object3DNode<THREE.Audio, typeof THREE.Audio>
~~~~~
node_modules/@types/react/index.d.ts:2837:13
2837 audio: React.DetailedHTMLProps<React.AudioHTMLAttributes<HTMLAudioElement>, HTMLAudioElement>;
~~~~~
'audio' was also declared here.
node_modules/react-three-fiber/types/src/three-types.d.ts:76:7 - error TS2717: Subsequent property declarations must have the same type. Property 'line' must be of type 'SVGProps<SVGLineElement>', but here has type 'Object3DNode<Line, typeof Line>'.
76 line: ReactThreeFiber.Object3DNode<THREE.Line, typeof THREE.Line>
~~~~
node_modules/@types/react/index.d.ts:2988:13
2988 line: React.SVGProps<SVGLineElement>;
~~~~
'line' was also declared here.
Found 2 errors.