fix Anchor component for links that only utilize onClick actions (thanks Vbriese)

pull/67/head
dperolio 3 years ago
parent f9e65f2f8b
commit fc84b6a3d5
No known key found for this signature in database
GPG Key ID: 3E9BBAA710D3DDCE

@ -15,7 +15,7 @@ const Anchor = AsyncComponent.fromDisplayName('Anchor');
const _labels = [ 'Component', 'Anchor' ];
const _error = (...message) => error({ labels: _labels, message });
export default memo(({ href, className, userId, children, type, addonId, ...other }) => {
export default memo(({ onClick, href, className, userId, children, type, addonId, ...other }) => {
return (
<Anchor
{...other}
@ -36,7 +36,11 @@ export default memo(({ href, className, userId, children, type, addonId, ...othe
*
*/
if (!userId && !addonId && !href) {
return evt.preventDefault();
if (!onClick) {
return evt.preventDefault();
} else {
onClick(evt);
}
}
/**

Loading…
Cancel
Save