Skip to content

Commit

Permalink
fixup! Refactor(web-react): Move away from the defaultProps
Browse files Browse the repository at this point in the history
  • Loading branch information
literat committed Apr 11, 2024
1 parent 925bd36 commit 3e38df8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/web-react/src/components/Field/ValidationText.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import React, { ElementType, useEffect } from 'react';
import { ValidationTextProps } from './types';

const defaultProps = {
const defaultProps: Partial<ValidationTextProps> = {
className: undefined,
elementType: 'div',
id: undefined,
registerAria: undefined,
};

export const ValidationText = (props: ValidationTextProps) => {
export const ValidationText = <T extends ElementType = 'div'>(props: ValidationTextProps<T>) => {
const propsWithDefaults = { ...defaultProps, ...props };
const {
className,
Expand Down

0 comments on commit 3e38df8

Please sign in to comment.