Refactor from
const CustomLink: React.PropsWithChildren<CustomLinkProps> = ({
href,
as,
className,
children,
style = {},
...props
}) => {
return (
<Link href={href} as={as} passHref>
<a
className={cx(className, styles.detailsLink)}
style={{
color: fetchThemeColor({ color: 'system' }, 'action'),
...style,
}}
{...props}
>
{children}
</a>
</Link>
);
};
to
const CustomLink = ({
href,
as,
className,
children,
style = {},
...props
}: React.PropsWithChildren<CustomLinkProps>) => {
return (
<Link href={href} as={as} passHref>
<a
className={cx(className, styles.detailsLink)}
style={{
color: fetchThemeColor({ color: 'system' }, 'action'),
...style,
}}
{...props}
>
{children}
</a>
</Link>
);
};
FIND
(const \w+): (React\.PropsWithChildren<\w+>) = \(\{([\s\S]*?)\}\) => \{
REPLACE
$1 = ({$3}: $2) => {
With optional props spread operator