Skip to content

Commit

Permalink
Remove unnecessary props in React wrapper components
Browse files Browse the repository at this point in the history
  • Loading branch information
lemonmade committed Jan 5, 2025
1 parent a60464a commit f39da5f
Show file tree
Hide file tree
Showing 24 changed files with 29 additions and 24 deletions.
5 changes: 5 additions & 0 deletions .changeset/young-waves-rest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@watching/clips-react': patch
---

Remove unnecessary props in React wrapper components
2 changes: 1 addition & 1 deletion packages/clips-react/source/components/BlockGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ declare module 'react' {
export const BlockGrid = forwardRef<BlockGridElement, BlockGridProps>(
function BlockGrid(props, ref) {
const wrapperRef = useCustomElementProperties(props, ref);
return <ui-block-grid {...props} ref={wrapperRef} />;
return <ui-block-grid ref={wrapperRef} />;
},
);
2 changes: 1 addition & 1 deletion packages/clips-react/source/components/BlockStack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ declare module 'react' {
export const BlockStack = forwardRef<BlockStackElement, BlockStackProps>(
function BlockStack(props, ref) {
const wrapperRef = useCustomElementProperties(props, ref);
return <ui-block-stack {...props} ref={wrapperRef} />;
return <ui-block-stack ref={wrapperRef} />;
},
);
2 changes: 1 addition & 1 deletion packages/clips-react/source/components/Button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const Button = forwardRef<ButtonElement, ButtonProps>(function Button(
const wrapperRef = useCustomElementProperties(allProps, ref);

return (
<ui-button {...allProps} ref={wrapperRef}>
<ui-button ref={wrapperRef}>
{children}
{overlay && isValidElement(overlay)
? cloneElement<any>(overlay, {slot: 'overlay'})
Expand Down
2 changes: 1 addition & 1 deletion packages/clips-react/source/components/Disclosure.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const Disclosure = forwardRef<DisclosureElement, DisclosureProps>(
const wrapperRef = useCustomElementProperties(allProps, ref);

return (
<ui-disclosure {...props} ref={wrapperRef}>
<ui-disclosure ref={wrapperRef}>
{children}
{labelElement}
</ui-disclosure>
Expand Down
2 changes: 1 addition & 1 deletion packages/clips-react/source/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ declare module 'react' {
export const Footer = forwardRef<FooterElement, FooterProps>(
function Footer(props, ref) {
const wrapperRef = useCustomElementProperties(props, ref);
return <ui-footer {...props} ref={wrapperRef} />;
return <ui-footer ref={wrapperRef} />;
},
);
2 changes: 1 addition & 1 deletion packages/clips-react/source/components/Grid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ declare module 'react' {
export const Grid = forwardRef<GridElement, GridProps>(
function Grid(props, ref) {
const wrapperRef = useCustomElementProperties(props, ref);
return <ui-grid {...props} ref={wrapperRef} />;
return <ui-grid ref={wrapperRef} />;
},
);
2 changes: 1 addition & 1 deletion packages/clips-react/source/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ declare module 'react' {
export const Header = forwardRef<HeaderElement, HeaderProps>(
function Header(props, ref) {
const wrapperRef = useCustomElementProperties(props, ref);
return <ui-header {...props} ref={wrapperRef} />;
return <ui-header ref={wrapperRef} />;
},
);
2 changes: 1 addition & 1 deletion packages/clips-react/source/components/Heading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ declare module 'react' {
export const Heading = forwardRef<HeadingElement, HeadingProps>(
function Heading(props, ref) {
const wrapperRef = useCustomElementProperties(props, ref);
return <ui-heading {...props} ref={wrapperRef} />;
return <ui-heading ref={wrapperRef} />;
},
);
2 changes: 1 addition & 1 deletion packages/clips-react/source/components/Image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ declare module 'react' {
export const Image = forwardRef<ImageElement, ImageProps>(
function Image(props, ref) {
const wrapperRef = useCustomElementProperties(props, ref);
return <ui-image {...props} ref={wrapperRef} />;
return <ui-image ref={wrapperRef} />;
},
);
2 changes: 1 addition & 1 deletion packages/clips-react/source/components/InlineGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ declare module 'react' {
export const InlineGrid = forwardRef<InlineGridElement, InlineGridProps>(
function InlineGrid(props, ref) {
const wrapperRef = useCustomElementProperties(props, ref);
return <ui-inline-grid {...props} ref={wrapperRef} />;
return <ui-inline-grid ref={wrapperRef} />;
},
);
4 changes: 2 additions & 2 deletions packages/clips-react/source/components/InlineStack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ declare module 'react' {
export const InlineStack = forwardRef<InlineStackElement, InlineStackProps>(
function InlineStack(props, ref) {
const wrapperRef = useCustomElementProperties(props, ref);
return <ui-inline-stack {...props} ref={wrapperRef} />;
return <ui-inline-stack ref={wrapperRef} />;
},
);
);
2 changes: 1 addition & 1 deletion packages/clips-react/source/components/Modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ declare module 'react' {
export const Modal = forwardRef<ModalElement, ModalProps>(
function Modal(props, ref) {
const wrapperRef = useCustomElementProperties(props, ref);
return <ui-modal {...props} ref={wrapperRef} />;
return <ui-modal ref={wrapperRef} />;
},
);
2 changes: 1 addition & 1 deletion packages/clips-react/source/components/Popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ declare module 'react' {
export const Popover = forwardRef<PopoverElement, PopoverProps>(
function Popover(props, ref) {
const wrapperRef = useCustomElementProperties(props, ref);
return <ui-popover {...props} ref={wrapperRef} />;
return <ui-popover ref={wrapperRef} />;
},
);
2 changes: 1 addition & 1 deletion packages/clips-react/source/components/Section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ declare module 'react' {
export const Section = forwardRef<SectionElement, SectionProps>(
function Section(props, ref) {
const wrapperRef = useCustomElementProperties(props, ref);
return <ui-section {...props} ref={wrapperRef} />;
return <ui-section ref={wrapperRef} />;
},
);
2 changes: 1 addition & 1 deletion packages/clips-react/source/components/SkeletonButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ export const SkeletonButton = forwardRef<
SkeletonButtonProps
>(function SkeletonButton(props, ref) {
const wrapperRef = useCustomElementProperties(props, ref);
return <ui-skeleton-button {...props} ref={wrapperRef} />;
return <ui-skeleton-button ref={wrapperRef} />;
});
2 changes: 1 addition & 1 deletion packages/clips-react/source/components/SkeletonText.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ declare module 'react' {
export const SkeletonText = forwardRef<SkeletonTextElement, SkeletonTextProps>(
function SkeletonText(props, ref) {
const wrapperRef = useCustomElementProperties(props, ref);
return <ui-skeleton-text {...props} ref={wrapperRef} />;
return <ui-skeleton-text ref={wrapperRef} />;
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ export const SkeletonTextBlock = forwardRef<
SkeletonTextBlockProps
>(function SkeletonTextBlock(props, ref) {
const wrapperRef = useCustomElementProperties(props, ref);
return <ui-skeleton-text-block {...props} ref={wrapperRef} />;
return <ui-skeleton-text-block ref={wrapperRef} />;
});
2 changes: 1 addition & 1 deletion packages/clips-react/source/components/SkeletonView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ declare module 'react' {
export const SkeletonView = forwardRef<SkeletonViewElement, SkeletonViewProps>(
function SkeletonView(props, ref) {
const wrapperRef = useCustomElementProperties(props, ref);
return <ui-skeleton-view {...props} ref={wrapperRef} />;
return <ui-skeleton-view ref={wrapperRef} />;
},
);
2 changes: 1 addition & 1 deletion packages/clips-react/source/components/Stack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@ declare module 'react' {
export const Stack = forwardRef<StackElement, StackProps>(
function Stack(props, ref) {
const wrapperRef = useCustomElementProperties(props, ref);
return <ui-stack {...props} ref={wrapperRef} />;
return <ui-stack ref={wrapperRef} />;
},
);
2 changes: 1 addition & 1 deletion packages/clips-react/source/components/Text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ declare module 'react' {
export const Text = forwardRef<TextElement, TextProps>(
function Text(props, ref) {
const wrapperRef = useCustomElementProperties(props, ref);
return <ui-text {...props} ref={wrapperRef} />;
return <ui-text ref={wrapperRef} />;
},
);
2 changes: 1 addition & 1 deletion packages/clips-react/source/components/TextBlock.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ declare module 'react' {
export const TextBlock = forwardRef<TextBlockElement, TextBlockProps>(
function TextBlock(props, ref) {
const wrapperRef = useCustomElementProperties(props, ref);
return <ui-text-block {...props} ref={wrapperRef} />;
return <ui-text-block ref={wrapperRef} />;
},
);
2 changes: 1 addition & 1 deletion packages/clips-react/source/components/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export const TextField = forwardRef<TextFieldElement, TextFieldProps>(
const wrapperRef = useCustomElementProperties(allProps, ref);

return (
<ui-text-field {...allProps} ref={wrapperRef}>
<ui-text-field ref={wrapperRef}>
{labelChild}
</ui-text-field>
);
Expand Down
2 changes: 1 addition & 1 deletion packages/clips-react/source/components/View.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ declare module 'react' {
export const View = forwardRef<ViewElement, ViewProps>(
function View(props, ref) {
const wrapperRef = useCustomElementProperties(props, ref);
return <ui-view {...props} ref={wrapperRef} />;
return <ui-view ref={wrapperRef} />;
},
);

0 comments on commit f39da5f

Please sign in to comment.