Skip to content

Commit 70eff65

Browse files
committed
perf: improve minified output
1 parent 052954f commit 70eff65

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Box.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ export type BoxProps<E extends React.ElementType> = BoxOwnProps<E> &
1212
const defaultElement = 'div';
1313

1414
export const Box = React.forwardRef(
15-
({ as, ...restProps }: BoxOwnProps, ref: React.Ref<Element>) => {
16-
const Element = as || defaultElement;
17-
return <Element ref={ref} {...restProps} />;
15+
(props: BoxOwnProps, ref: React.Ref<Element>) => {
16+
const Element = props.as || defaultElement;
17+
return <Element ref={ref} {...props} as={undefined} />;
1818
},
1919
) as <E extends React.ElementType = typeof defaultElement>(
2020
props: BoxProps<E>,

0 commit comments

Comments
 (0)