Skip to content

Commit 8fd9bf1

Browse files
committed
chore(react-docsite-components): resolve issues related to React 18 types
1 parent 2182f63 commit 8fd9bf1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+69
-63
lines changed

packages/react-docsite-components/src/components/Animation/AnimationDetail/AnimationDetail.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const styles = mergeStyleSets({
2525
},
2626
});
2727

28-
export const AnimationDetail: React.FunctionComponent<IAnimationDetailProps> = props => {
28+
export const AnimationDetail: React.FunctionComponent<React.PropsWithChildren<IAnimationDetailProps>> = props => {
2929
const { animation, coreClass, reactVariable } = props;
3030

3131
return (

packages/react-docsite-components/src/components/Animation/AnimationDetailGrid/AnimationDetailGrid.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const styles = mergeStyleSets({
1414
},
1515
});
1616

17-
export const AnimationDetailGrid: React.FunctionComponent<IAnimationDetailGridProps> = props => {
17+
export const AnimationDetailGrid: React.FunctionComponent<React.PropsWithChildren<IAnimationDetailGridProps>> = props => {
1818
return (
1919
<div className={styles.root}>
2020
{props.children.map((item: JSX.Element, i: number) => (

packages/react-docsite-components/src/components/ApiReferencesTable/ApiReferencesTable.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,17 +182,17 @@ export class ApiReferencesTable extends React.Component<IApiReferencesTableProps
182182

183183
return title ? (
184184
// This heading must be programmatically focusable for simulating jumping to an anchor
185-
<Text variant="xLarge" as="h3" styles={{ root: { marginTop: 0 } }} id={name} tabIndex={-1}>
185+
(<Text variant="xLarge" as="h3" styles={{ root: { marginTop: 0 } }} id={name} tabIndex={-1}>
186186
{title}
187-
</Text>
187+
</Text>)
188188
) : undefined;
189189
}
190190
}
191191

192192
/**
193193
* Memoized DetailsList wrapper handling scenarios specific to API reference tables.
194194
*/
195-
const ApiDetailsList: React.FunctionComponent<IApiDetailsListProps> = React.memo(props => {
195+
const ApiDetailsList: React.FunctionComponent<React.PropsWithChildren<IApiDetailsListProps>> = React.memo(props => {
196196
// Alphabetize the items and add a key to each one.
197197
const { itemKind, items, ariaLabel } = props;
198198
const processedItems: IApiEnumProperty[] | IApiInterfaceProperty[] | IMethod[] = useConst(() => {

packages/react-docsite-components/src/components/App/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ export interface IAppState {
2222
const getClassNames = classNamesFunction<IAppStyleProps, IAppStyles>();
2323

2424
@withResponsiveMode
25-
export class AppBase extends React.Component<IAppProps, IAppState> {
25+
export class AppBase extends React.Component<React.PropsWithChildren<IAppProps>, IAppState> {
2626
public state: IAppState = { isMenuVisible: false, isMenuClosing: false };
2727
private _classNames: IProcessedStyleSet<IAppStyles>;
2828
private _showOnlyExamples: boolean;
@@ -211,7 +211,7 @@ function _findMatchingLink(links: INavLink[], path: string): INavLink | undefine
211211
}
212212
}
213213

214-
export const App: React.FunctionComponent<IAppProps> = styled<IAppProps, IAppStyleProps, IAppStyles>(
214+
export const App: React.FunctionComponent<React.PropsWithChildren<IAppProps>> = styled<IAppProps, IAppStyleProps, IAppStyles>(
215215
AppBase,
216216
getStyles,
217217
undefined,

packages/react-docsite-components/src/components/CodeSnippet/CodeSnippet.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ const languageMapping: { [key: string]: string } = {
7979
css: 'scss',
8080
};
8181

82-
const CodeSnippetBase: React.FunctionComponent<ICodeSnippetProps> = props => {
82+
const CodeSnippetBase: React.FunctionComponent<React.PropsWithChildren<ICodeSnippetProps>> = props => {
8383
const classNames = getClassNames(props.styles, { className: props.className });
8484
return (
8585
<SyntaxHighlighter
@@ -92,7 +92,7 @@ const CodeSnippetBase: React.FunctionComponent<ICodeSnippetProps> = props => {
9292
);
9393
};
9494

95-
export const CodeSnippet: React.FunctionComponent<ICodeSnippetProps> = styled<
95+
export const CodeSnippet: React.FunctionComponent<React.PropsWithChildren<ICodeSnippetProps>> = styled<
9696
ICodeSnippetProps,
9797
ICodeSnippetStyleProps,
9898
ICodeSnippetStyles

packages/react-docsite-components/src/components/CodeSnippet/PrismCodeSnippet.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@ const languageMapping: { [key: string]: string } = {
126126
css: 'scss',
127127
};
128128

129-
const PrismCodeSnippetBase: React.FunctionComponent<ICodeSnippetProps> = props => {
129+
const PrismCodeSnippetBase: React.FunctionComponent<
130+
React.PropsWithChildren<React.PropsWithChildren<ICodeSnippetProps>>
131+
> = props => {
130132
const classNames = getClassNames(props.styles, {});
131133
return (
132134
<SyntaxHighlighter
@@ -140,7 +142,7 @@ const PrismCodeSnippetBase: React.FunctionComponent<ICodeSnippetProps> = props =
140142
);
141143
};
142144

143-
export const PrismCodeSnippet: React.FunctionComponent<ICodeSnippetProps> = styled<
145+
export const PrismCodeSnippet: React.FunctionComponent<React.PropsWithChildren<ICodeSnippetProps>> = styled<
144146
ICodeSnippetProps,
145147
ICodeSnippetStyleProps,
146148
ICodeSnippetStyles

packages/react-docsite-components/src/components/CodepenComponent/CodepenComponent.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ interface ICodepenPrefill {
2727
// and other options--see https://blog.codepen.io/documentation/api/prefill/
2828
}
2929

30-
const CodepenComponentBase: React.FunctionComponent<ICodepenProps> = props => {
30+
const CodepenComponentBase: React.FunctionComponent<React.PropsWithChildren<ICodepenProps>> = props => {
3131
const { jsContent = '', buttonAs: ButtonType = CommandButton, styles, theme } = props;
3232

3333
const inputRef = React.useRef<HTMLInputElement>(null);
@@ -94,7 +94,7 @@ const CodepenComponentBase: React.FunctionComponent<ICodepenProps> = props => {
9494
);
9595
};
9696

97-
export const CodepenComponent: React.FunctionComponent<ICodepenProps> = styled<
97+
export const CodepenComponent: React.FunctionComponent<React.PropsWithChildren<ICodepenProps>> = styled<
9898
ICodepenProps,
9999
ICodepenStyleProps,
100100
ICodepenStyles

packages/react-docsite-components/src/components/ColorPalette/ColorPalette.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ class ColorPaletteBase extends React.Component<IColorPaletteProps, IColorPalette
195195
};
196196
}
197197

198-
export const ColorPalette: React.FunctionComponent<IColorPaletteProps> = styled<
198+
export const ColorPalette: React.FunctionComponent<React.PropsWithChildren<IColorPaletteProps>> = styled<
199199
IColorPaletteProps,
200200
IColorPaletteStyleProps,
201201
IColorPaletteStyles

packages/react-docsite-components/src/components/ComponentPage/ComponentPage.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ function _idFromSectionTitle(title: string): string {
313313
return title.replace(/[^\w-]/g, '');
314314
}
315315

316-
export const ComponentPage: React.FunctionComponent<IComponentPageProps> = styled<
316+
export const ComponentPage: React.FunctionComponent<React.PropsWithChildren<IComponentPageProps>> = styled<
317317
IComponentPageProps,
318318
IComponentPageStyleProps,
319319
IComponentPageStyles

packages/react-docsite-components/src/components/EditSection/EditSection.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const getClassNames = classNamesFunction<IEditSectionStyleProps, IEditSectionSty
1111
/**
1212
* Component for displaying an edit button next to a section header.
1313
*/
14-
export const EditSectionBase: React.FunctionComponent<IEditSectionProps> = props => {
14+
export const EditSectionBase: React.FunctionComponent<React.PropsWithChildren<IEditSectionProps>> = props => {
1515
const { className, section, title, url, styles, theme } = props;
1616

1717
// Check if url is falsey.
@@ -38,7 +38,7 @@ export const EditSectionBase: React.FunctionComponent<IEditSectionProps> = props
3838
);
3939
};
4040

41-
export const EditSection: React.FunctionComponent<IEditSectionProps> = styled<
41+
export const EditSection: React.FunctionComponent<React.PropsWithChildren<IEditSectionProps>> = styled<
4242
IEditSectionProps,
4343
IEditSectionStyleProps,
4444
IEditSectionStyles

0 commit comments

Comments
 (0)