Skip to content

Commit

Permalink
Update index.jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
omsaggau authored Jun 26, 2023
1 parent da657a0 commit fc023d1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/components/Button/index.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import React, { forwardRef } from 'react';
import PropTypes from 'prop-types';

const Button = ({
const Button = forwardRef(({
children, className, disabled, icon, negative, onClick, primary, type, ariaLabel, onKeyDown,
}, ref) => (
<button
Expand All @@ -16,7 +16,9 @@ const Button = ({
{icon && <div className="sb-icon">{icon}</div>}
{children}
</button>
);
));

Button.displayName = 'Button';

Button.defaultProps = {
className: '',
Expand All @@ -42,4 +44,4 @@ Button.propTypes = {
onKeyDown: PropTypes.func,
};

export default React.forwardRef(Button);
export default Button;

0 comments on commit fc023d1

Please sign in to comment.