-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Type definitions for JSX attributes and events #1007
Comments
the first step for this feature is completed by creating this utility library https://github.com/muxinc/ce-la-react this library supports TS and need to be plugged in our React wrapper build script here: |
#1068) This PR fix this [issue](#1007) by: - Add [ce-la-react](https://github.com/muxinc/ce-la-react) - Modify the build.js in react to use ce-la-react - Add attributes as properties to create type definitions - Remove the creation of the d.ts files in build since the new implementation generate them. - move some components imports to be found in ce-la-react Note: Styles inline need to be set as any to don't have a warning from typescript error.  --------- Co-authored-by: Wesley Luyten <me@wesleyluyten.com>
…ributes (#1068) This PR fix this [issue](#1007) by: - Add [ce-la-react](https://github.com/muxinc/ce-la-react) - Modify the build.js in react to use ce-la-react - Add attributes as properties to create type definitions - Remove the creation of the d.ts files in build since the new implementation generate them. - move some components imports to be found in ce-la-react Note: Styles inline need to be set as any to don't have a warning from typescript error.  --------- Co-authored-by: Wesley Luyten <me@wesleyluyten.com>
Hi @littlespex Thanks for your feedback and for helping us improve the developer experience in Media Chrome! This issue has been closed today, and the latest version now includes attributes and events prediction and types functionality as requested. Let me know if you want any further tweaks! 😊 |
The react build script generates types for the
media-chrome
web components based onGenericForwardRef
. While this provides basic typing it doesn't provide definitions for the component's attributes, or React style event handlers (React'sonClick
vs the DOMonclick
). This prevents strict type checking and code completion/hints:vs
If possible, it would improve DX if each component's attributes were added to the
JSX
namespace.The text was updated successfully, but these errors were encountered: