Skip to content

Commit

Permalink
remove duplicate
Browse files Browse the repository at this point in the history
  • Loading branch information
cansuaa committed Jun 20, 2024
1 parent 1b4744c commit 65d984f
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions src/internal/base-component/use-base-component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,3 @@ export default function useBaseComponent<T = any>(componentName: string, config?
const elementRef = useComponentMetadata<T>(componentName, PACKAGE_VERSION);
return { __internalRootRef: elementRef };
}

// we also support data-* attributes, but they are always implicitly allowed by typescript
// http://www.typescriptlang.org/docs/handbook/jsx.html#attribute-type-checking
// "Note: If an attribute name is not a valid JS identifier (like a data-* attribute), it is not considered to be an error"
// eslint-disable-next-line @typescript-eslint/no-empty-interface
export interface BaseComponentProps {}

export function getBaseProps(props: BaseComponentProps) {
const baseProps: Record<string, string> = {};
Object.keys(props).forEach((prop) => {
if (prop.startsWith("data-")) {
baseProps[prop] = (props as Record<string, string>)[prop];
}
});
return baseProps;
}

0 comments on commit 65d984f

Please sign in to comment.