-
Notifications
You must be signed in to change notification settings - Fork 841
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
Convert EuiText, EuiTextColor and EuiTextAlign to TS #1791
Conversation
TS certainly doesn't make it easy to track down some error's root locations! The issue is
This is an irk of mine where the React API works opposite of how we talk about props: "EuiText takes the important things like size, color, and className, and then any extra props we don't care about" whereas the API gives a higher priority to props that appear later, which matches how JS objects work:
It is more correct to place the rest spread at the beginning of the props in most cases because of this, but that is non-unintuitive and rarely matters. |
@chandlerprall thanks for the tip, this is ready to review now. |
src/components/text/index.ts
Outdated
@@ -0,0 +1,5 @@ | |||
export { EuiText, TextSize, TEXT_SIZES } from './text'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file should only export the components (match the same export signature as the removed index.js and index.d.ts, both of which only export the components). The other values shouldn't be used/usable outside of EUI, and internally other components an require them directly from their source files.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@chandlerprall I've changed the index to only export the components.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM!
jenkins test this |
Summary
Convert EuiText, EuiTextColor and EuiTextAlign to TypeScript.
Checklist