chore: Convert EuiCustomLink to TypeScript in /ui#5059
Merged
franciscojavierarceo merged 1 commit intoMar 1, 2025
Conversation
This was the last JavaScript component, convert it to TypeScript too. The `href` prop was never used, so we omit it from the props type definition, and no longer pass it to the component. We could also have chosen to drop the `to` prop and use `href` instead, but `to` is used by React Router's Link (https://reactrouter.com/6.29.0/components/link), and it makes sense to use the same name in EuiCustomLink since we pass it to React Router's `navigate` function; the naming hints that it's tied to React Router and not just a regular URL path. Signed-off-by: Harri Lehtola <peruukki@hotmail.com>
056bd2c to
f8d41d1
Compare
Contributor
Author
|
This is still waiting for a review, would someone be available for it? 🙏 |
Member
|
@peruukki feel free to tag me directly next time! Sorry for the delay there! Thank you for your contribution! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this PR does / why we need it:
EuiCustomLink was the last JavaScript component, convert it to TypeScript too.
Which issue(s) this PR fixes:
No related issue.
Misc
The
hrefprop was never used, so we omit it from the props type definition, and no longer pass it to the component. (We definehrefin EuiCustomLink based on the passedtoprop.)We could also have chosen to drop the
toprop and usehrefinstead, buttois used by React Router's Link, and it makes sense to use the same name in EuiCustomLink since we pass it to React Router'snavigatefunction; the naming hints that it's tied to React Router and not just a regular URL path.These changes partially overlap with #5004, but I'll remove such changes from the other PR if this gets merged first, and vice versa.