TypeScript Linter Issue with Passing JSX Event Handler Prop in Custom Component #11740
Unanswered
dontry
asked this question in
Help/Questions
Replies: 1 comment 1 reply
-
It seems only happened to jsx. It works well with Maybe it is a bug of |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I’ve created a MyButton component and attempted to pass a JSX event handler prop, onClick, directly to the component without explicitly declaring it. My expectation was that the prop would automatically fall through to the underlying button element, which seems valid as the code runs without any errors at runtime.
However, I’m encountering an issue where the TypeScript linter flags this as a problem. Could anyone suggest a workaround or a best practice for handling this situation while keeping the linter happy?
MyButton Component
Typescript error
Beta Was this translation helpful? Give feedback.
All reactions