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

Button with react-route wont work #10955

Closed
1 task done
weisenic opened this issue Apr 7, 2018 · 3 comments
Closed
1 task done

Button with react-route wont work #10955

weisenic opened this issue Apr 7, 2018 · 3 comments
Labels
support: question Community support but can be turned into an improvement

Comments

@weisenic
Copy link

weisenic commented Apr 7, 2018

This applies for material-ui-next with typescript an react-router

  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

Following the example in the Docs on how to integrate a router:
2018-04-07 13_32_32-buttons - material-ui
I should be able to use this Button as a Link

Current Behavior

The button wont render at all. In the result HTML an with the correct href but zero width and height is generated

Steps to Reproduce (for bugs)

I've created a Repo with the relevant implementation (in src/App.tsx).
Clone the Repository and run $ yarn and $ yarn run start to reproduce.

@mbrookes
Copy link
Member

mbrookes commented Apr 7, 2018

@oliviertassinari
Copy link
Member

oliviertassinari commented Apr 7, 2018

We even have a live demo for this: https://material-ui.com/guides/composition/#component-property.

-const MyLink = () => <Link to="/test-route" />;
+const MyLink = (props: Props) => <Link to="/test-route" {...props} />;

@oliviertassinari oliviertassinari added support: question Community support but can be turned into an improvement support: Stack Overflow Please ask the community on Stack Overflow labels Apr 7, 2018
@support
Copy link

support bot commented Apr 7, 2018

👋 Thanks for using Material-UI!

We use the issue tracker exclusively for bug reports and feature requests, however,
this issue appears to be a support request or question. Please ask on StackOverflow where the
community will do their best to help. There is a "material-ui" tag that you can use to tag your
question.

If you would like to link from here to your question on SO, it will help others find it.
If your issues is confirmed as a bug, you are welcome to reopen the issue using the issue template.

@oliviertassinari oliviertassinari removed the support: Stack Overflow Please ask the community on Stack Overflow label Apr 7, 2018
@support support bot reopened this Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
support: question Community support but can be turned into an improvement
Projects
None yet
Development

No branches or pull requests

3 participants