Keep selected props required in React output target (e.g., modal open) #6459
apenab
started this conversation in
Stencil Testing
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! When generating React proxies with @stencil/react-output-target, all props become optional. For modals/dialogs we need open to be required in React.
Problem: In React, open is emitted as optional, allowing without open.
Why it matters: Design-system components often have contractual props; compile-time enforcement prevents misuse.
Ask: Is there a built-in way to keep certain props required in the generated React types? If not, would you consider:
• Config: requiredProps: { 'nova-modal': ['open'] }
• Hint: @prop({ required: true }) or JSDoc @required propagated to React d.ts
• Hook: a callback to post-process emitted prop types
Beta Was this translation helpful? Give feedback.
All reactions