-
Notifications
You must be signed in to change notification settings - Fork 87
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
[feat] Link Component #145
Comments
I like this idea, but I think the rendered component should be customizable somehow in case the user is using client-side routing and needs more than a basic |
We could use |
We need further discussion of what kind of user/developer experience we want for handling the customizable component. Requirements
Do these requirements seem correct?? Also, here are two approaches for consideration:
|
I should be clear that after seeing the solution proposed by @haworku I like it way better than the one I worked on. |
okay I’m looking at this a little bit and I have some thoughts/questions:
Ultimately I would keep in mind two things:
|
Thanks for the response and pointing out the separate concerns! Very helpful. Syntax - syntax could change for passing in the custom component. We could use Conflicting Props - yes this this the main question as well as the the prop interface on Link. I hear you saying that person shouldn't use our component.
|
After futzing for a bit, I really don't think it's possible for us to determine if their custom component also uses |
@ahobson do you want to rework #309 to handle styles also?? We can rely on typescript to warn about invalid props and just add a comment in the component file of what it supported. It should be quick - I suggest looking at the earlier version of my PR last week - it handles everything with styles and also uses |
This shipped in #320 |
Make a basic
Link
component that wraps a link in the classes we need for an internal linkusa-link
versus and external linkusa-link usa-link--external
.This is another way to encapsulate styles. See Typography > Links.
By default renders an anchor tag, but has an optional prop to accept a different component.
The text was updated successfully, but these errors were encountered: