Skip to content

Commit

Permalink
Fix removal of polymorphism for RangeControl
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrobertshaw committed Jun 23, 2022
1 parent 26fed6f commit f0d1336
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
9 changes: 7 additions & 2 deletions packages/components/src/range-control/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,17 @@ import {
Wrapper,
} from './styles/range-control-styles';

import type { UnforwardedRangeControlProps } from './types';
import type { RangeControlProps } from './types';
import type { WordPressComponentProps } from '../ui/context';

const noop = () => {};

function UnforwardedRangeControl< IconProps = unknown >(
props: UnforwardedRangeControlProps< IconProps >,
props: WordPressComponentProps<
RangeControlProps< IconProps >,
'div',
false
>,
ref: ForwardedRef< HTMLDivElement >
) {
const {
Expand Down
6 changes: 0 additions & 6 deletions packages/components/src/range-control/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import type {
*/
import type { BaseControlProps } from '../base-control/types';
import type { IconType } from '../icon';
import type { WordPressComponentProps } from '../ui/context';

export type NumericProps = {
/**
Expand Down Expand Up @@ -229,11 +228,6 @@ export type RangeControlProps< IconProps = unknown > = Pick<
withInputField?: boolean;
};

export type UnforwardedRangeControlProps< IconProps = unknown > = Omit<
WordPressComponentProps< RangeControlProps< IconProps >, 'div' >,
'as'
>;

export type RailProps = MarksProps & {
railColor?: CSSProperties[ 'color' ];
};
Expand Down

0 comments on commit f0d1336

Please sign in to comment.