Skip to content

Commit

Permalink
build(dev-deps): update @types/react (#8233)
Browse files Browse the repository at this point in the history
Обновляем типы для реакта. React.FC теперь может возвращать промис
  • Loading branch information
SevereCloud authored Feb 5, 2025
1 parent 0ca9ed9 commit e79e19c
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 14 deletions.
3 changes: 2 additions & 1 deletion packages/vkui-docs-theme/src/components/Head.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ export function Head() {
const { resolvedColorScheme } = useColorScheme();
const mounted = useMounted();

const head = typeof themeConfig.head === 'function' ? themeConfig.head({}) : themeConfig.head;
const ThemeConfigHead = themeConfig.head;
const head = typeof ThemeConfigHead === 'function' ? <ThemeConfigHead /> : ThemeConfigHead;

return (
<NextHead>
Expand Down
5 changes: 3 additions & 2 deletions packages/vkui-docs-theme/src/mdx/Main/Main.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type * as React from 'react';
import * as React from 'react';
import { Breadcrumbs, NavLinks } from '../../components';
import { useConfig, useThemeConfig } from '../../contexts';
import styles from './Main.module.css';
Expand All @@ -25,7 +25,8 @@ export function Main({ children }: { children: React.ReactNode }) {
</>
);

const body = themeConfig.main?.({ children: content }) || content;
const ThemeConfigMain = themeConfig.main || React.Fragment;
const body = <ThemeConfigMain>{content}</ThemeConfigMain>;

if (themeContext.layout === 'full') {
return <main className={styles.content}>{body}</main>;
Expand Down
6 changes: 3 additions & 3 deletions packages/vkui/src/testing/e2e/ComponentPlayground.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface InternalComponentPlaygroundProps<Props = React.ComponentProps<'
colorScheme: ColorSchemeType;
adaptivityProviderProps?: Partial<AdaptivityProps>;
propSets?: Parameters<typeof multiCartesian<Props>>[0];
children: (props: Props) => React.ReactNode;
children: React.FC<Props>;
AppWrapper?: React.ComponentType<AppDefaultWrapperProps>;
}

Expand All @@ -36,7 +36,7 @@ export const ComponentPlayground = <
platform,
adaptivityProviderProps: adaptivityProviderPropsProp,
propSets = [],
children,
children: Children,
AppWrapper = AppDefaultWrapper,
...restProps
}: InternalComponentPlaygroundProps<Props>): React.ReactNode => {
Expand Down Expand Up @@ -90,7 +90,7 @@ export const ComponentPlayground = <
)}
<div>
<AdaptivityProvider {...clonedAdaptivityProviderProps}>
{children(mappedProps)}
<Children {...mappedProps} />
</AdaptivityProvider>
</div>
</React.Fragment>
Expand Down
16 changes: 8 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4974,11 +4974,11 @@ __metadata:
linkType: hard

"@types/react-dom@npm:^19.0.1":
version: 19.0.1
resolution: "@types/react-dom@npm:19.0.1"
dependencies:
"@types/react": "npm:*"
checksum: 10/59d0704e445a3e0d034ef016c92dc1bbec0ba6c1af084bf6de18f0ac3abd18a632961b7fd48668c519137d0bd7bfa77a8135a66c2725d4b7f68b830be263a564
version: 19.0.3
resolution: "@types/react-dom@npm:19.0.3"
peerDependencies:
"@types/react": ^19.0.0
checksum: 10/815907f7adaa078acbf1d1ae7b6bf69cebe86bd301b8b9744e392bc0f16feb31bfb9fe0bfa2681d7d86678c83d52dedba5ed9bc7776736d4050cdd426b8b2d2b
languageName: node
linkType: hard

Expand All @@ -4992,11 +4992,11 @@ __metadata:
linkType: hard

"@types/react@npm:*, @types/react@npm:^19.0.1":
version: 19.0.1
resolution: "@types/react@npm:19.0.1"
version: 19.0.8
resolution: "@types/react@npm:19.0.8"
dependencies:
csstype: "npm:^3.0.2"
checksum: 10/930dd4904047059c48ae64a90fc5e8078b5bac0a14c9d927917e5a07e88e4e5073ddc944cbde90a955f9f815c23b7112caea63e407bc423913073bedecb097aa
checksum: 10/1080d5b96ee0b4395f8f167ae6952f570088ee03bdce69f8237aab82c32d9bd2b71106f787bac17ba351acc4aba5e3454bafca51f2eb11d1562073b821e63d15
languageName: node
linkType: hard

Expand Down

0 comments on commit e79e19c

Please sign in to comment.