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 containerElement property absent in v1 #7649

Closed
mickykebe opened this issue Aug 3, 2017 · 3 comments
Closed

Button containerElement property absent in v1 #7649

mickykebe opened this issue Aug 3, 2017 · 3 comments
Labels

Comments

@mickykebe
Copy link

Button doesn't have a containerElement property in v1. I was trying to use the button with a react router Link. All solutions I found suggest using containerElement property which is absent in v1.

Versions

  • Material-UI: v1-beta
@oliviertassinari
Copy link
Member

We have some example of buttons used as link in the documentation. To put it short, use the component property. One important limitation to be aware of, you can't use a functional component as we need to get a ref for handling the focus logic.

@mickykebe
Copy link
Author

I don't want the button to work as a regular link but a react router link in the manner described here.

<FlatButton containerElement={<Link to="/login"/>} />

The code below in v0(EnhancedButton) has no equivalent in v1.
if (React.isValidElement(containerElement)) { return React.cloneElement(containerElement, buttonProps, buttonChildren); }

@franva
Copy link

franva commented Feb 28, 2018

I met the same issue. What is the solution???

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

No branches or pull requests

3 participants