check the length of href to deside wich element to render

This commit is contained in:
NikolaBorislavovHristov 2019-08-22 14:31:51 +03:00
parent d92a2b7d05
commit 4e85b21b73

View file

@ -27,7 +27,7 @@ const Button = React.forwardRef(({ children, ...props }, ref) => {
}
}, [props.onMouseDown]);
return React.createElement(
typeof props.href === 'string' ? 'a' : 'div',
typeof props.href === 'string' && props.href.length > 0 ? 'a' : 'div',
{
...props,
ref,