The TestRenderer package imports "internal" types from Fiber package #2061
-
I'm currently setting up a project to use @react-three/test-renderer and it causes type-checking to fail because it imports types from @react-three/fiber that aren't exposed in the the published package: ../../node_modules/@react-three/test-renderer/dist/declarations/src/types/internal.d.ts:4:32 - error TS2307: Cannot find module '@react-three/fiber/src/core/store' or its corresponding type declarations.
4 import type { RootState } from '@react-three/fiber/src/core/store'; Now, I can work around this issue by setting I think the way forward would be to expose the necessary types from @react-three/fiber. Since y'all are using Preconstruct, it would be pretty easy to expose them on an entrypoint in the case it doesn't make sense to expose them on the main entrypoint. Here's an example of creating a import type { BaseInstance, LocalState } from '@react-three/fiber/core'
import type { RootState } from '@react-three/fiber/core'; vs. exporting the types from the root entry: import type { BaseInstance, LocalState } from '@react-three/fiber';
import type { RootState } from '@react-three/fiber'; Let me know what y'all think, I can open a PR for this. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
I agree, they should have been exported. Weird they weren't... please do make a PR 👍🏻 |
Beta Was this translation helpful? Give feedback.
-
@joshuaellis any preference as to whether I export the types directly from |
Beta Was this translation helpful? Give feedback.
-
Actually, you know what, I did not even check as to whether the types are already exported from @react-three/fiber... it could be that @react-three/test-renderer just references them incorrectly (note the |
Beta Was this translation helpful? Give feedback.
-
I probably would. I don't think they're that secret. It's probably easier to evaluate in a PR! |
Beta Was this translation helpful? Give feedback.
I agree, they should have been exported. Weird they weren't... please do make a PR 👍🏻