-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
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
Avoid rendering <a> element #2708
Conversation
I think that it's going to be a breaking change. |
@oliviertassinari How are you using href? can you give me an example? might help me better understand how we can migrate. |
I'm using the href in a import React from 'react';
import PureRenderMixin from 'react-addons-pure-render-mixin';
const LinkExternal = React.createClass({
propTypes: {
children: React.PropTypes.element,
href: React.PropTypes.string,
},
mixins: [
PureRenderMixin,
],
render() {
const {
href,
children,
} = this.props;
return React.cloneElement(children, {
href: href,
target: '_blank',
});
},
});
export default LinkExternal; @patrykkopycinski Is using it this way: https://jsfiddle.net/g3thx9e9/ |
So you think we should introduce this breaking change? I mean it's not documented I don't think we should migrate. Is fixing those easy for you? Should I ease it a bit? I can check for the existence of href and use |
Yes, it's easy to fix.
That sounds simple to do. I think that it's a good idea. |
Ok, I'll implement it tonight. 👍 Thanks for the feedback ^_^ |
I have noticed another case where the |
😱 Crap. Alright then I won't deprecate it for now either. I'll check for the existence of href and render |
9db8d54
to
24e43ea
Compare
@oliviertassinari I eased the migration a bit. If it's alright with you do the merging 😁 |
[EnhancedButton] Avoid rendering <a> element
@alitaheri That should be good 👍. |
Thanks ^_^ 🎉 🎈 |
Could you document the usage of |
@jgoux I'm using this with success: <Link to="/something">
<ListItem
primaryText="xsadasds"
/>
</Link> |
Indeed ! 👍 Related issue : #3557 |
@jgoux Not sure, I'll have to check that one out, thanks for bringing it up. |
This remains an issue for me on iOS 10 Mobile Safari homescreen apps: <MenuItem
containerElement={<Link to={'/path'} />}
primaryText="Link Name"
/> This works in the regular Mobile Safari browser, but when you make that web app a homescreen app, these links begin to fail with no errors, the tap is simply eaten up. If you tap for slightly longer, it registers, but this is definitely broken. (I suspect it might have something to do with Any suggestions to fix this? @nathanmarks solution works, but since it wraps the entire |
What about this situation? A listItem with a call-to-action in the right button.
<ListItem primaryText="Users"
leftIcon={<IconPerson />} containerElement={<Link to="/admin/user/list" />}
rightIcon={<IconButton children={<IconAdd />} containerElement={<Link to="/admin/user" />} />}
/> |
@damianobarbati That was solved on the |
@mismith could you solve your issue. I'm facing the exact same issue and its quite irritating. @oliviertassinari could you please suggest any workaround for the issue mentioned by @mismith |
This has caused many issues, when an element is created in this component there will be no way to support links, as nested elements is offensive in the eyes of HTML.
Closes #2178, #1979, #1823
@oliviertassinari Take a look at this. I don't think is can be a braeking change since an
href
was never specified on the link. But I'm not sure...