Skip to content

Commit 22271dc

Browse files
committed
Fix deprecated types: React.ReactText
1 parent ac15225 commit 22271dc

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

packages/components/src/tools-panel/stories/index.story.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export const Default: StoryFn< typeof ToolsPanel > = ( {
5353
const [ height, setHeight ] = useState< string | undefined >();
5454
const [ minHeight, setMinHeight ] = useState< string | undefined >();
5555
const [ width, setWidth ] = useState< string | undefined >();
56-
const [ scale, setScale ] = useState< React.ReactText | undefined >();
56+
const [ scale, setScale ] = useState< number | string | undefined >();
5757

5858
const resetAll: typeof resetAllProp = ( filters ) => {
5959
setHeight( undefined );
@@ -402,7 +402,7 @@ export const WithConditionalDefaultControl: StoryFn< typeof ToolsPanel > = ( {
402402
} ) => {
403403
const [ attributes, setAttributes ] = useState< {
404404
height?: string;
405-
scale?: React.ReactText;
405+
scale?: number | string;
406406
} >( {} );
407407
const { height, scale } = attributes;
408408

@@ -498,7 +498,7 @@ export const WithConditionallyRenderedControl: StoryFn<
498498
> = ( { resetAll: resetAllProp, panelId, ...props } ) => {
499499
const [ attributes, setAttributes ] = useState< {
500500
height?: string;
501-
scale?: React.ReactText;
501+
scale?: number | string;
502502
} >( {} );
503503
const { height, scale } = attributes;
504504

packages/components/src/utils/font-size.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/**
22
* External dependencies
33
*/
4-
import type { CSSProperties, ReactText } from 'react';
4+
import type { CSSProperties } from 'react';
55

66
/**
77
* Internal dependencies
@@ -61,7 +61,7 @@ export function getFontSize(
6161
return `calc(${ ratio } * ${ CONFIG.fontSize })`;
6262
}
6363

64-
export function getHeadingFontSize( size: ReactText = 3 ): string {
64+
export function getHeadingFontSize( size: number | string = 3 ): string {
6565
if ( ! HEADING_FONT_SIZES.includes( size as HeadingSize ) ) {
6666
return getFontSize( size );
6767
}

0 commit comments

Comments
 (0)