-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Dealing with Button as a NavLink of react router gives a react warning #2295
Comments
@sharno in your codesandbox example your App component is written as a stateless functional component. I think if you write it as a class it should work. |
@brianespinosa It seems not to be the case, I updated the same codesandbox to be a class component and it's still giving the same error. |
Thanks a lot @layershifter .. will use HOC for now until it's fixed then. I really appreciate your and other contributors' work on Semantic UI React here, it's really elegant and I use it in most of my work. |
@sharno so sorry about that. I looked at your codesandbox too quickly. And thanks for catching that @layershifter. |
@layershifter @brianespinosa Was this ever fixed? I'm using 0.77.2 and still getting this error
when rendering this button:
|
Can someone show a HOC solution? |
Steps
Add a NavLink from
react-router
to a button, ex:<Button as={NavLink} to={"/members/" + user.id}>Click</Button>
Expected Result
no warnings
Actual Result
Version
0.75.1
Testcase
https://codesandbox.io/s/8xm89o4j3l
Is it a bug or I shouldn't use the button this way? Any alternatives to get a button working as a link that changes in styling or should I manage the styling manually and use just a Link instead?
The text was updated successfully, but these errors were encountered: