Resolve a warning in <Button> related to not using React.forwardRef
Signed-off-by: Oliver Sand <oliver.sand@sda-se.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/core-components': patch
|
||||
---
|
||||
|
||||
Resolve a warning in `<Button>` related to not using `React.forwardRef`.
|
||||
@@ -43,7 +43,9 @@ declare function ButtonType(props: ButtonProps): JSX.Element;
|
||||
/**
|
||||
* This wrapper is here to reset the color of the Link and make typescript happy.
|
||||
*/
|
||||
const LinkWrapper = (props: LinkProps) => <Link {...props} color="initial" />;
|
||||
const LinkWrapper = React.forwardRef<any, LinkProps>((props, ref) => (
|
||||
<Link ref={ref} {...props} color="initial" />
|
||||
));
|
||||
|
||||
const ActualButton = React.forwardRef<any, ButtonProps>((props, ref) => (
|
||||
<MaterialButton ref={ref} component={LinkWrapper} {...props} />
|
||||
|
||||
Reference in New Issue
Block a user