You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/* TypeScript file generated from index.res by genType. *//* eslint-disable *//* tslint:disable */import*asindexJSfrom'./index.res.js';importtype{Jsx_elementasPervasivesU_Jsx_element}from'../src/shims/PervasivesU.shim';importtype{propsasNotWorking_props}from'./NotWorking.gen';importtype{propsasWorking_props}from'./Working.gen';exporttypeworkaroundProps=NotWorking_props;exportconstNotWorking: React.ComponentType<{readonlychildren: React.ReactNode;readonlynot_imported: not_imported}>=indexJS.NotWorkingasany;
As you can see the type not_imported is not imported
Reproduction
A minimal reproduction example is available in this GitHub repository: gentype-error-reproduction. It outlines the setup and demonstrates the specific steps needed to observe the problematic behavior.
Workaround
By redefining the props within the index.res file as follows, I found a temporary solution:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hey!
I've identified an issue with genType with React component
Explaination
I have two components which are globally the same
And
When compiling these components the types generated by @genType are good 👌
But if I want to export then from another file like that:
The
index.gen.tsx
generated by genType is:As you can see the type
not_imported
is not importedReproduction
A minimal reproduction example is available in this GitHub repository: gentype-error-reproduction. It outlines the setup and demonstrates the specific steps needed to observe the problematic behavior.
Workaround
By redefining the props within the index.res file as follows, I found a temporary solution:
This approach forces a correct import of types in the generated TypeScript file, avoiding the issue temporarily.
Question
Is the identified workaround the recommended approach to this issue, or does it highlight a bug within genType that needs addressing?
Have a great day :)
The text was updated successfully, but these errors were encountered: