@@ -3,7 +3,6 @@ import PropTypes from 'prop-types';
33import { omit } from 'ramda' ;
44import RBButton from 'react-bootstrap/Button' ;
55import Link from '../../private/Link' ;
6- import { sanitizeAndCheckUrl } from '../../private/util' ;
76
87/**
98 * A component for creating Bootstrap buttons with different style options. The
@@ -35,8 +34,6 @@ const Button = props => {
3534 ...otherProps
3635 } = props ;
3736
38- const sanitizedUrl = sanitizeAndCheckUrl ( href , setProps ) ;
39-
4037 const incrementClicks = ( ) => {
4138 if ( ! disabled && setProps ) {
4239 setProps ( {
@@ -45,7 +42,7 @@ const Button = props => {
4542 } ) ;
4643 }
4744 } ;
48- const useLink = sanitizedUrl && ! disabled ;
45+ const useLink = href && ! disabled ;
4946 otherProps [ useLink ? 'preOnClick' : 'onClick' ] = onClick || incrementClicks ;
5047
5148 if ( useLink ) {
@@ -59,7 +56,7 @@ const Button = props => {
5956 as = { useLink ? Link : 'button' }
6057 variant = { outline ? `outline-${ color } ` : color }
6158 type = { useLink ? undefined : type }
62- href = { disabled ? undefined : sanitizedUrl }
59+ href = { disabled ? undefined : href }
6360 disabled = { disabled }
6461 download = { useLink ? download : undefined }
6562 name = { useLink ? undefined : name }
0 commit comments