-
-
Notifications
You must be signed in to change notification settings - Fork 32.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
Can't seem to integrate the Tabs Component and React Router to change url. #8313
Comments
Do something like: <Tab label="Facebook" component={Link} to="/facebook" /> |
Current Tab and Link Code:
My route code looks like this.
But, once I load the page, this error shows up.
My components that the routes are supposed to render are not there either and if I click any tab, this error is given.
|
Nevermind, I changed how I was importing and it's working. Thanks! |
@davidfufu perhaps you could elaborate how you fixed this? |
I believe I switched to "export default Component". Before, I was using multiple defaults from one file and destructuring them when importing like "import { Component1, Component2}". |
|
@evalcraciun |
I got this error message
|
This method makes it so that when a tab is pressed, the link hover text stays visible at the bottom of the page until you click elsewhere or select a different tab. |
What about Next.js How could I add a link to a Edit: |
This solution should still be valid: https://material-ui.com/guides/composition/#routing-libraries |
Thank you for the answer! |
Just as a preface, I have checked stackoverlow's material UI section.
I'm having trouble integrating React routing's Link Tag with Material UI Tabs.
I've tried putting the Link in the Tab. The result is that there are no errors, but upon clicking the Tabs, the url does not change.
I've also tried passing the Link in using the children property. This doesn't change the url either, nor does cause any errors.
Finally wrapping Tab in Link as given below breaks the tab bar component and returns an error of:
The text was updated successfully, but these errors were encountered: