From 58ddcf1c032aa3fd49316685ee4c9a00cebe037b Mon Sep 17 00:00:00 2001 From: Julian Kobrynski Date: Mon, 28 Aug 2023 10:25:25 +0200 Subject: [PATCH] migrate ThemeStylesProvider to TypeScript --- ...hemeStylesProvider.js => ThemeStylesProvider.tsx} | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) rename src/styles/{ThemeStylesProvider.js => ThemeStylesProvider.tsx} (69%) diff --git a/src/styles/ThemeStylesProvider.js b/src/styles/ThemeStylesProvider.tsx similarity index 69% rename from src/styles/ThemeStylesProvider.js rename to src/styles/ThemeStylesProvider.tsx index 4653605fc079..d8a081572644 100644 --- a/src/styles/ThemeStylesProvider.js +++ b/src/styles/ThemeStylesProvider.tsx @@ -1,16 +1,14 @@ /* eslint-disable react/jsx-props-no-spreading */ import React, {useMemo} from 'react'; -import PropTypes from 'prop-types'; import useTheme from './themes/useTheme'; import StylesContext from './ThemeStylesContext'; import defaultStyles from './styles'; -const propTypes = { - /** Rendered child component */ - children: PropTypes.node.isRequired, +type ThemeStylesProviderProps = { + children: React.ReactNode; }; -function ThemeStylesProvider(props) { +function ThemeStylesProvider({children}: ThemeStylesProviderProps) { const theme = useTheme(); const appContentStyle = useMemo( @@ -29,9 +27,9 @@ function ThemeStylesProvider(props) { [appContentStyle], ); - return {props.children}; + return {children}; } -ThemeStylesProvider.propTypes = propTypes; + ThemeStylesProvider.displayName = 'ThemeStylesProvider'; export default ThemeStylesProvider;