We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 052954f commit 70eff65Copy full SHA for 70eff65
src/Box.tsx
@@ -12,9 +12,9 @@ export type BoxProps<E extends React.ElementType> = BoxOwnProps<E> &
12
const defaultElement = 'div';
13
14
export const Box = React.forwardRef(
15
- ({ as, ...restProps }: BoxOwnProps, ref: React.Ref<Element>) => {
16
- const Element = as || defaultElement;
17
- return <Element ref={ref} {...restProps} />;
+ (props: BoxOwnProps, ref: React.Ref<Element>) => {
+ const Element = props.as || defaultElement;
+ return <Element ref={ref} {...props} as={undefined} />;
18
},
19
) as <E extends React.ElementType = typeof defaultElement>(
20
props: BoxProps<E>,
0 commit comments