Skip to content
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

Add support NextLink and other custom link components #2004

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jadnast
Copy link

@jadnast jadnast commented Dec 21, 2024

Added support for using custom link components (e.g., NextLink) in the Button component via the new hrefComponent prop. If hrefComponent is not specified, it defaults to <a>.

Details:

  • Introduced a new prop hrefComponent in ButtonProps.
  • If hrefComponent is provided, it will render the specified component for links instead of <a>.
  • Maintains backward compatibility by defaulting to <a> when hrefComponent is not set.
  • Ensures flexibility for projects using custom routing libraries like Next.js.

Related Tickets & Documents

I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en

Added support for using custom link components (e.g., NextLink) in the Button component via the new hrefComponent prop. If hrefComponent is not specified, it defaults to <a>.

Details:

- Introduced a new prop hrefComponent in ButtonProps.
- If hrefComponent is provided, it will render the specified component for links instead of <a>.
- Maintains backward compatibility by defaulting to <a> when hrefComponent is not set.
- Ensures flexibility for projects using custom routing libraries like Next.js.

Signed-off-by: Nikita Kononenko <[email protected]>
@jadnast jadnast requested a review from amje as a code owner December 21, 2024 00:32
@amje
Copy link
Contributor

amje commented Dec 24, 2024

@jadnast Hi, we've already attempted to support this in #1594 and we'll add it to the next branch (that will be 7 release) soon. You can be able to use only component prop, without need of extra props

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants