Commit 231e620f by Łukasz Siatka Committed by Lukas Siatka

Explore: updates responsive button to forward ref

parent c9645a96
import React from 'react';
import React, { forwardRef } from 'react';
export enum IconSide {
left = 'left',
......@@ -19,7 +19,7 @@ function formatBtnTitle(title: string, iconSide?: string): string {
return iconSide === IconSide.left ? '\xA0' + title : iconSide === IconSide.right ? title + '\xA0' : title;
}
export const ResponsiveButton = (props: Props) => {
export const ResponsiveButton = forwardRef<HTMLButtonElement, Props>((props, ref) => {
const defaultProps = {
iconSide: IconSide.left,
};
......@@ -37,4 +37,4 @@ export const ResponsiveButton = (props: Props) => {
{iconClassName && iconSide === IconSide.right ? <i className={`${iconClassName}`} /> : null}
</button>
);
};
});
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment