-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
Classname Props and other props on <Link/> except 'href' do not work #127
Comments
@cungminh2710 it is an API design decision. You can add styles to children (you can even have an anchor as its children) |
I came across this also, a solution as described might look something like:
|
this is super weird.. we probably should accept className and style as props in the link component |
@impronunciable what are the downsides of not accepting props like It seems very odd to have to pass an anchor element as a child to |
Would be super interested in having the className working with also or having a good understanding of why this is a bad idea ;-) . My current use case is the following, i use semantic ui for my app and i can do something like that to render semantic default element as a Link for the next/router to catch the route, but this is trashing the layout cause Link doesn't set the semantic Menu className.
I do a workaround using onClick - e.preventDefault() - url.pushTo('page1') , but this is not ideal. Thanks anyway for the great work here |
@flybayer You can always style it from the parent instead of trying to pass more elements down with Link. Having Links with classes however, seems like a common practice, specially in any of the frameworks around. A simple example, Links that show up as buttons. I'd be interested in knowing any downsides to allowing different props to pass down to the |
The title says it all.
The text was updated successfully, but these errors were encountered: