diff --git a/apps/chart-docsite/src/DocsComponents/FluentDocsContainer.tsx b/apps/chart-docsite/src/DocsComponents/FluentDocsContainer.tsx index 118e756ccca4a..598199640e3cf 100644 --- a/apps/chart-docsite/src/DocsComponents/FluentDocsContainer.tsx +++ b/apps/chart-docsite/src/DocsComponents/FluentDocsContainer.tsx @@ -11,7 +11,10 @@ interface FluentDocsContainerProps { /** * A container that wraps storybook's native docs container to add extra components to the docs experience */ -export const FluentDocsContainer: React.FC = ({ children, context }) => { +export const FluentDocsContainer: React.FC> = ({ + children, + context, +}) => { return ( <> {/** TODO add table of contents */} diff --git a/apps/react-18-tests-v8/package.json b/apps/react-18-tests-v8/package.json index 6f7f7c57eab3d..48f317ea683e8 100644 --- a/apps/react-18-tests-v8/package.json +++ b/apps/react-18-tests-v8/package.json @@ -25,9 +25,9 @@ "@fluentui/react": "*", "@fluentui/react-hooks": "*", "@types/react": "18.3.20", - "@types/react-dom": "18.3.5", "react": "18.3.1", "react-dom": "18.3.1", + "@types/react-dom": "18.3.5", "tslib": "^2.1.0" } } diff --git a/apps/react-18-tests-v9/package.json b/apps/react-18-tests-v9/package.json index 383be2a774550..307a264039f9e 100644 --- a/apps/react-18-tests-v9/package.json +++ b/apps/react-18-tests-v9/package.json @@ -21,9 +21,9 @@ "dependencies": { "@cypress/react": "9.0.1", "@fluentui/react-components": "*", - "@testing-library/dom": "^10.1.0", - "@testing-library/react": "^16.0.0", - "@testing-library/user-event": "^14.5.2", + "@testing-library/dom": "^10.4.0", + "@testing-library/react": "^16.2.0", + "@testing-library/user-event": "^14.6.1", "@types/react": "18.3.20", "@types/react-dom": "18.3.5", "@types/react-test-renderer": "18.3.1", diff --git a/apps/vr-tests/src/stories/ThemeProvider/ThemeProviderLoadTheme.stories.tsx b/apps/vr-tests/src/stories/ThemeProvider/ThemeProviderLoadTheme.stories.tsx index 44141ef37aebc..4a83905d1a58d 100644 --- a/apps/vr-tests/src/stories/ThemeProvider/ThemeProviderLoadTheme.stories.tsx +++ b/apps/vr-tests/src/stories/ThemeProvider/ThemeProviderLoadTheme.stories.tsx @@ -21,10 +21,12 @@ export default { ], }; -const LoadThemeTestButton: React.FunctionComponent<{ - buttonAs?: React.ElementType; - buttonProps?: any; -}> = props => { +const LoadThemeTestButton: React.FunctionComponent< + React.PropsWithChildren<{ + buttonAs?: React.ElementType; + buttonProps?: any; + }> +> = props => { const [isThemeCustomized, setIsThemeCustomized] = React.useState(false); // toggle between default theme and customized theme diff --git a/change/@fluentui-react-aria-8f78fc18-0062-4b31-943b-49d1f8fb792c.json b/change/@fluentui-react-aria-8f78fc18-0062-4b31-943b-49d1f8fb792c.json new file mode 100644 index 0000000000000..1403653d7f3a8 --- /dev/null +++ b/change/@fluentui-react-aria-8f78fc18-0062-4b31-943b-49d1f8fb792c.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "chore: slot API react v17/18 support", + "packageName": "@fluentui/react-aria", + "email": "bernardo.sunderhus@gmail.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-datepicker-compat-40e91e26-ec95-4c11-8598-3e6bf2be277d.json b/change/@fluentui-react-datepicker-compat-40e91e26-ec95-4c11-8598-3e6bf2be277d.json new file mode 100644 index 0000000000000..edf33f876a428 --- /dev/null +++ b/change/@fluentui-react-datepicker-compat-40e91e26-ec95-4c11-8598-3e6bf2be277d.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "chore: slot API react v17/18 support", + "packageName": "@fluentui/react-datepicker-compat", + "email": "bernardo.sunderhus@gmail.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-dialog-237cafe3-9fa1-45dc-b20f-602b7de1fd4c.json b/change/@fluentui-react-dialog-237cafe3-9fa1-45dc-b20f-602b7de1fd4c.json new file mode 100644 index 0000000000000..196d18f7875ff --- /dev/null +++ b/change/@fluentui-react-dialog-237cafe3-9fa1-45dc-b20f-602b7de1fd4c.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "\u0002chore: slot API react v17/18 support", + "packageName": "@fluentui/react-dialog", + "email": "bernardo.sunderhus@gmail.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-drawer-70c3f806-65d7-4b1f-aaba-3a92ade08fee.json b/change/@fluentui-react-drawer-70c3f806-65d7-4b1f-aaba-3a92ade08fee.json new file mode 100644 index 0000000000000..103e38996d6ac --- /dev/null +++ b/change/@fluentui-react-drawer-70c3f806-65d7-4b1f-aaba-3a92ade08fee.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "chore: deprecates ComponentState.components property", + "packageName": "@fluentui/react-drawer", + "email": "bernardo.sunderhus@gmail.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-jsx-runtime-12473640-484d-4699-a36c-5d9e9c7a1622.json b/change/@fluentui-react-jsx-runtime-12473640-484d-4699-a36c-5d9e9c7a1622.json new file mode 100644 index 0000000000000..10deaee299fa5 --- /dev/null +++ b/change/@fluentui-react-jsx-runtime-12473640-484d-4699-a36c-5d9e9c7a1622.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "chore: slot API react v17/18 support", + "packageName": "@fluentui/react-jsx-runtime", + "email": "bernardo.sunderhus@gmail.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-menu-625c3222-142a-430e-b5de-4b0d6ecd800c.json b/change/@fluentui-react-menu-625c3222-142a-430e-b5de-4b0d6ecd800c.json new file mode 100644 index 0000000000000..033f99fc8f6f7 --- /dev/null +++ b/change/@fluentui-react-menu-625c3222-142a-430e-b5de-4b0d6ecd800c.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "chore: slot API react v17/18 support", + "packageName": "@fluentui/react-menu", + "email": "bernardo.sunderhus@gmail.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-migration-v0-v9-e5bd1559-048d-4423-8339-c1ef4cd8aa29.json b/change/@fluentui-react-migration-v0-v9-e5bd1559-048d-4423-8339-c1ef4cd8aa29.json new file mode 100644 index 0000000000000..532068cc9d04b --- /dev/null +++ b/change/@fluentui-react-migration-v0-v9-e5bd1559-048d-4423-8339-c1ef4cd8aa29.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "chore: slot API react v17/18 support", + "packageName": "@fluentui/react-migration-v0-v9", + "email": "bernardo.sunderhus@gmail.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-migration-v8-v9-0dbfdec5-c535-461c-979a-dedf2e792f13.json b/change/@fluentui-react-migration-v8-v9-0dbfdec5-c535-461c-979a-dedf2e792f13.json new file mode 100644 index 0000000000000..b64f6fd7cc2de --- /dev/null +++ b/change/@fluentui-react-migration-v8-v9-0dbfdec5-c535-461c-979a-dedf2e792f13.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "chore: slot API react v17/18 support", + "packageName": "@fluentui/react-migration-v8-v9", + "email": "bernardo.sunderhus@gmail.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-motion-bbf27d86-dd78-4b8e-907f-f1ba2d458f88.json b/change/@fluentui-react-motion-bbf27d86-dd78-4b8e-907f-f1ba2d458f88.json new file mode 100644 index 0000000000000..375dcecd461af --- /dev/null +++ b/change/@fluentui-react-motion-bbf27d86-dd78-4b8e-907f-f1ba2d458f88.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "chore: slot API react v17/18 support", + "packageName": "@fluentui/react-motion", + "email": "bernardo.sunderhus@gmail.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-search-f1e14f72-5b28-44d0-bb5e-7cc3260e00a4.json b/change/@fluentui-react-search-f1e14f72-5b28-44d0-bb5e-7cc3260e00a4.json new file mode 100644 index 0000000000000..9bd15e00b2e81 --- /dev/null +++ b/change/@fluentui-react-search-f1e14f72-5b28-44d0-bb5e-7cc3260e00a4.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "chore: deprecates ComponentState.components property", + "packageName": "@fluentui/react-search", + "email": "bernardo.sunderhus@gmail.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-table-b21a0221-810f-4b38-b928-13e54251c56b.json b/change/@fluentui-react-table-b21a0221-810f-4b38-b928-13e54251c56b.json new file mode 100644 index 0000000000000..26a546220a475 --- /dev/null +++ b/change/@fluentui-react-table-b21a0221-810f-4b38-b928-13e54251c56b.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "chore: slot API react v17/18 support", + "packageName": "@fluentui/react-table", + "email": "bernardo.sunderhus@gmail.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-tabs-536a8e63-1156-4ebc-8595-e72351ff0d29.json b/change/@fluentui-react-tabs-536a8e63-1156-4ebc-8595-e72351ff0d29.json new file mode 100644 index 0000000000000..b6d7ee4594564 --- /dev/null +++ b/change/@fluentui-react-tabs-536a8e63-1156-4ebc-8595-e72351ff0d29.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "chore: slot API react v17/18 support", + "packageName": "@fluentui/react-tabs", + "email": "bernardo.sunderhus@gmail.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-tag-picker-e9aa92f6-cda0-4905-8d4d-13d63785c30b.json b/change/@fluentui-react-tag-picker-e9aa92f6-cda0-4905-8d4d-13d63785c30b.json new file mode 100644 index 0000000000000..34c5c83f97f82 --- /dev/null +++ b/change/@fluentui-react-tag-picker-e9aa92f6-cda0-4905-8d4d-13d63785c30b.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "chore: deprecates ComponentState.components property", + "packageName": "@fluentui/react-tag-picker", + "email": "bernardo.sunderhus@gmail.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-toast-ba1e922d-1d50-4b25-97af-f776b995023a.json b/change/@fluentui-react-toast-ba1e922d-1d50-4b25-97af-f776b995023a.json new file mode 100644 index 0000000000000..d935266f701ec --- /dev/null +++ b/change/@fluentui-react-toast-ba1e922d-1d50-4b25-97af-f776b995023a.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "chore: slot API react v17/18 support", + "packageName": "@fluentui/react-toast", + "email": "bernardo.sunderhus@gmail.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-toolbar-199bf58f-2421-486a-bcf1-535db8cb98cf.json b/change/@fluentui-react-toolbar-199bf58f-2421-486a-bcf1-535db8cb98cf.json new file mode 100644 index 0000000000000..1768e5829fcfe --- /dev/null +++ b/change/@fluentui-react-toolbar-199bf58f-2421-486a-bcf1-535db8cb98cf.json @@ -0,0 +1,7 @@ +{ + "type": "patch", + "comment": "chore: slot API react v17/18 support", + "packageName": "@fluentui/react-toolbar", + "email": "bernardo.sunderhus@gmail.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-utilities-852e0ed2-030e-44aa-b7f5-c16ea6283aa2.json b/change/@fluentui-react-utilities-852e0ed2-030e-44aa-b7f5-c16ea6283aa2.json new file mode 100644 index 0000000000000..5130827b8da53 --- /dev/null +++ b/change/@fluentui-react-utilities-852e0ed2-030e-44aa-b7f5-c16ea6283aa2.json @@ -0,0 +1,7 @@ +{ + "type": "minor", + "comment": "chore: slot API react v17/18 support", + "packageName": "@fluentui/react-utilities", + "email": "bernardo.sunderhus@gmail.com", + "dependentChangeType": "patch" +} diff --git a/change/@fluentui-react-virtualizer-672c17bd-9097-418a-af72-9283de7b72dd.json b/change/@fluentui-react-virtualizer-672c17bd-9097-418a-af72-9283de7b72dd.json new file mode 100644 index 0000000000000..1e2f10400c4ba --- /dev/null +++ b/change/@fluentui-react-virtualizer-672c17bd-9097-418a-af72-9283de7b72dd.json @@ -0,0 +1,7 @@ +{ + "type": "prerelease", + "comment": "chore: deprecates ComponentState.components property", + "packageName": "@fluentui/react-virtualizer", + "email": "bernardo.sunderhus@gmail.com", + "dependentChangeType": "patch" +} diff --git a/package.json b/package.json index f06d3bdcae186..d78c03bfa65c6 100644 --- a/package.json +++ b/package.json @@ -108,11 +108,11 @@ "@swc/core": "1.5.7", "@swc/helpers": "0.5.1", "@swc/jest": "0.2.36", - "@testing-library/dom": "8.11.3", - "@testing-library/jest-dom": "5.16.5", - "@testing-library/react": "12.1.2", + "@testing-library/dom": "10.4.0", + "@testing-library/jest-dom": "6.6.3", + "@testing-library/react": "16.2.0", "@testing-library/react-hooks": "8.0.1", - "@testing-library/user-event": "13.5.0", + "@testing-library/user-event": "14.6.1", "@tsconfig/node18": "1.0.3", "@types/babel__core": "7.20.5", "@types/babel__helper-plugin-utils": "7.10.3", @@ -156,10 +156,10 @@ "@types/node": "20.12.12", "@types/prettier": "2.7.2", "@types/progress": "2.0.5", - "@types/react": "17.0.44", - "@types/react-dom": "17.0.15", - "@types/react-is": "17.0.3", - "@types/react-test-renderer": "17.0.2", + "@types/react": "18.3.20", + "@types/react-dom": "18.3.5", + "@types/react-is": "18.3.1", + "@types/react-test-renderer": "18.3.1", "@types/react-transition-group": "4.4.6", "@types/react-window": "^1.8.2", "@types/request-promise-native": "1.0.18", @@ -295,13 +295,13 @@ "progress": "2.0.3", "puppeteer": "19.6.0", "raw-loader": "4.0.2", - "react": "17.0.2", + "react": "18.3.1", "react-app-polyfill": "2.0.0", - "react-dom": "17.0.2", + "react-dom": "18.3.1", "react-hot-loader": "4.13.0", - "react-is": "17.0.2", + "react-is": "18.3.1", "react-shadow": "20.3.0", - "react-test-renderer": "17.0.2", + "react-test-renderer": "18.3.1", "react-vis": "1.12.1", "react-window": "^1.8.6", "read-pkg-up": "7.0.1", @@ -383,8 +383,7 @@ "swc-loader": "^0.2.6", "prettier": "2.8.8", "puppeteer": "19.6.0", - "ws": "8.17.1", - "**/@mdx-js/react/@types/react": "^17" + "ws": "8.17.1" }, "nx": { "includedScripts": [] diff --git a/packages/charts/react-charting/src/components/ResponsiveContainer/ResponsiveContainer.tsx b/packages/charts/react-charting/src/components/ResponsiveContainer/ResponsiveContainer.tsx index fc2bc364e1117..764bb6db88033 100644 --- a/packages/charts/react-charting/src/components/ResponsiveContainer/ResponsiveContainer.tsx +++ b/packages/charts/react-charting/src/components/ResponsiveContainer/ResponsiveContainer.tsx @@ -78,7 +78,9 @@ export const ResponsiveContainer: React.FC = props => // Keep components styles ...child.props.styles, root: { - ...child.props.styles?.root, + ...(typeof child.props.styles !== 'function' && typeof child.props.styles?.root === 'object' + ? child.props?.styles?.root + : {}), // Ensure the child element fills the parent container // https://stackoverflow.com/questions/8468066/child-inside-parent-with-min-height-100-not-inheriting-height width: calculatedWidth, diff --git a/packages/charts/react-charting/src/utilities/locale-util.ts b/packages/charts/react-charting/src/utilities/locale-util.ts index 862aa45c8d38a..f2eb6d02ec3eb 100644 --- a/packages/charts/react-charting/src/utilities/locale-util.ts +++ b/packages/charts/react-charting/src/utilities/locale-util.ts @@ -1,5 +1,5 @@ type LocaleStringDataProps = number | string | Date | undefined; -export const convertToLocaleString = (data: LocaleStringDataProps, culture?: string): LocaleStringDataProps => { +export const convertToLocaleString = (data: LocaleStringDataProps, culture?: string): string | number | undefined => { if (!data) { return data; } diff --git a/packages/charts/react-charting/tsconfig.json b/packages/charts/react-charting/tsconfig.json index c75bba0249fd9..c14e8fe3816f9 100644 --- a/packages/charts/react-charting/tsconfig.json +++ b/packages/charts/react-charting/tsconfig.json @@ -17,8 +17,8 @@ "preserveConstEnums": true, "skipLibCheck": true, "lib": ["es5", "dom"], - "typeRoots": ["../../../node_modules/@types", "../../../typings"], - "types": ["jest", "custom-global", "@testing-library/jest-dom"], + "typeRoots": ["../../../node_modules/@types", "../../../typings", "../../../node_modules/@testing-library"], + "types": ["jest", "custom-global", "jest-dom"], "isolatedModules": true }, "include": ["src"] diff --git a/packages/fluentui/code-sandbox/src/SandboxApp.tsx b/packages/fluentui/code-sandbox/src/SandboxApp.tsx index 9f6334d30d47f..53c64996ad1ed 100644 --- a/packages/fluentui/code-sandbox/src/SandboxApp.tsx +++ b/packages/fluentui/code-sandbox/src/SandboxApp.tsx @@ -55,7 +55,7 @@ const themes = { teamsHighContrastTheme, }; -export const SandboxApp: React.FunctionComponent = props => { +export const SandboxApp: React.FunctionComponent> = props => { const { children } = props; const [theme, setTheme] = React.useState(items[0].value); diff --git a/packages/fluentui/docs-components/src/CodeSnippet/CodeSnippetLabel.tsx b/packages/fluentui/docs-components/src/CodeSnippet/CodeSnippetLabel.tsx index 8e24352038a5e..2ddbe1f97890e 100644 --- a/packages/fluentui/docs-components/src/CodeSnippet/CodeSnippetLabel.tsx +++ b/packages/fluentui/docs-components/src/CodeSnippet/CodeSnippetLabel.tsx @@ -22,7 +22,7 @@ const copyIcon = ( ); -export const CodeSnippetLabel: React.FunctionComponent = props => { +export const CodeSnippetLabel: React.FunctionComponent> = props => { const { copyable, label, mode, value } = props; const hasLabel = label !== false; diff --git a/packages/fluentui/docs-components/src/knobs/KnobProvider.tsx b/packages/fluentui/docs-components/src/knobs/KnobProvider.tsx index 26952ee7cb540..600a844de78bc 100644 --- a/packages/fluentui/docs-components/src/knobs/KnobProvider.tsx +++ b/packages/fluentui/docs-components/src/knobs/KnobProvider.tsx @@ -14,7 +14,7 @@ type KnobProviderProps = { components?: Partial; }; -export const KnobProvider: React.FunctionComponent = props => { +export const KnobProvider: React.FunctionComponent> = props => { const { children, components } = props; const [knobs, setKnobs] = React.useState({}); diff --git a/packages/fluentui/docs-components/src/knobs/LogInspector.tsx b/packages/fluentui/docs-components/src/knobs/LogInspector.tsx index 301a620e8ca16..db99cb6e63458 100644 --- a/packages/fluentui/docs-components/src/knobs/LogInspector.tsx +++ b/packages/fluentui/docs-components/src/knobs/LogInspector.tsx @@ -6,7 +6,7 @@ type LogInspectorProps = { silent?: boolean; }; -export const LogInspector: React.FunctionComponent = props => { +export const LogInspector: React.FunctionComponent> = props => { const { components } = React.useContext(KnobContext); const { clearLog } = React.useContext(LogContextFunctions); diff --git a/packages/fluentui/docs-components/src/knobs/defaultComponents.tsx b/packages/fluentui/docs-components/src/knobs/defaultComponents.tsx index 293e127a8edee..8e52d002cfe50 100644 --- a/packages/fluentui/docs-components/src/knobs/defaultComponents.tsx +++ b/packages/fluentui/docs-components/src/knobs/defaultComponents.tsx @@ -8,7 +8,7 @@ import { } from './types'; import { parseValue } from './utils/parseRangeValue'; -const KnobField: React.FunctionComponent = props => ( +const KnobField: React.FunctionComponent> = props => (
= props => (
); -const KnobControl: React.FunctionComponent = props => ( +const KnobControl: React.FunctionComponent> = props => ( = props => ( ); -const KnobLabel: React.FunctionComponent = props => ( +const KnobLabel: React.FunctionComponent> = props => ( ); -const KnobBoolean: React.FunctionComponent = props => ( +const KnobBoolean: React.FunctionComponent> = props => ( = props => ( /> ); -const KnobNumber: React.FunctionComponent = props => ( +const KnobNumber: React.FunctionComponent> = props => ( ) => { @@ -76,7 +76,7 @@ const KnobNumber: React.FunctionComponent = props /> ); -const KnobSelect: React.FunctionComponent = props => ( +const KnobSelect: React.FunctionComponent> = props => ( ); -const KnobRange: React.FunctionComponent = props => ( +const KnobRange: React.FunctionComponent> = props => ( = props => /> ); -const KnobString: React.FunctionComponent = props => ( +const KnobString: React.FunctionComponent> = props => ( ) => { @@ -120,7 +120,7 @@ const KnobString: React.FunctionComponent = props => ( /> ); -const LogInspector: React.FunctionComponent = props => ( +const LogInspector: React.FunctionComponent> = props => ( <>
diff --git a/packages/fluentui/docs-components/src/knobs/types.ts b/packages/fluentui/docs-components/src/knobs/types.ts index b662aafc76cdc..35ae1687d2cff 100644 --- a/packages/fluentui/docs-components/src/knobs/types.ts +++ b/packages/fluentui/docs-components/src/knobs/types.ts @@ -13,7 +13,7 @@ export type KnobName = string; export type KnobSet = Record; -export type KnobComponent

= React.FunctionComponent

; +export type KnobComponent

= React.FunctionComponent>; export type KnobComponents = { KnobField: KnobComponent; @@ -26,7 +26,7 @@ export type KnobComponents = { KnobSelect: KnobComponent; KnobString: KnobComponent; - LogInspector: React.FunctionComponent; + LogInspector: React.FunctionComponent>; }; export type KnobComponentProps = KnobDefinition & { diff --git a/packages/fluentui/docs/src/app.tsx b/packages/fluentui/docs/src/app.tsx index 47669c3c5ddd3..79ee22ee05c14 100644 --- a/packages/fluentui/docs/src/app.tsx +++ b/packages/fluentui/docs/src/app.tsx @@ -53,7 +53,7 @@ function useRendererFactory(): CreateRenderer { return rendererFactory; } -const App: React.FC = () => { +const App: React.FC> = () => { const [themeName, setThemeName] = React.useState(themeContextDefaults.themeName); // State also contains the updater function so it will // be passed down into the context provider diff --git a/packages/fluentui/docs/src/components/ComponentBestPractices.tsx b/packages/fluentui/docs/src/components/ComponentBestPractices.tsx index 77d7d2d593656..0dca55324c8bb 100644 --- a/packages/fluentui/docs/src/components/ComponentBestPractices.tsx +++ b/packages/fluentui/docs/src/components/ComponentBestPractices.tsx @@ -17,7 +17,7 @@ export type ComponentBestPracticesProps = Extendable<{ dontList?: React.ReactNode[]; }>; -const ComponentBestPractices: React.FC = ({ doList, dontList }) => { +const ComponentBestPractices: React.FC> = ({ doList, dontList }) => { const updatedDoList: ShorthandCollection = []; const updatedDontList: ShorthandCollection = []; diff --git a/packages/fluentui/docs/src/components/ComponentDoc/BehaviorDescription.tsx b/packages/fluentui/docs/src/components/ComponentDoc/BehaviorDescription.tsx index 0097da5ac791d..5ad1de244ee1e 100644 --- a/packages/fluentui/docs/src/components/ComponentDoc/BehaviorDescription.tsx +++ b/packages/fluentui/docs/src/components/ComponentDoc/BehaviorDescription.tsx @@ -5,7 +5,7 @@ const AccessibilityDescription = React.lazy(() => import('./InlineMarkdown')); const item = '- '; -const BehaviorDescription: React.FunctionComponent<{ value: string }> = ({ value }) => { +const BehaviorDescription: React.FunctionComponent> = ({ value }) => { // doctrine has a bug where it ignores list item indicator (-) if it is in the beginning of the comment // because of that, add the list item indicators after parsing const markdown = diff --git a/packages/fluentui/docs/src/components/ComponentDoc/ComponentBundleSizeExample/ComponentBundleSizeExample.tsx b/packages/fluentui/docs/src/components/ComponentDoc/ComponentBundleSizeExample/ComponentBundleSizeExample.tsx index a3625b97fff84..31b47d45c9059 100644 --- a/packages/fluentui/docs/src/components/ComponentDoc/ComponentBundleSizeExample/ComponentBundleSizeExample.tsx +++ b/packages/fluentui/docs/src/components/ComponentDoc/ComponentBundleSizeExample/ComponentBundleSizeExample.tsx @@ -12,7 +12,7 @@ export interface ComponentBundleSizeExampleProps { examplePath: string; } -const ComponentBundleSizeExample: React.FunctionComponent = props => { +const ComponentBundleSizeExample: React.FunctionComponent> = props => { const { title, description, examplePath } = props; // "components/Divider/Performance/Divider.bsize" -> dividerBSizeTsxJs const perfTestName = `${_.camelCase(_.last(examplePath.split('/')))}TsxJs`; diff --git a/packages/fluentui/docs/src/components/ComponentDoc/ComponentControls/ComponentControls.tsx b/packages/fluentui/docs/src/components/ComponentDoc/ComponentControls/ComponentControls.tsx index 28bcc697c2a79..5d98ac2101501 100644 --- a/packages/fluentui/docs/src/components/ComponentDoc/ComponentControls/ComponentControls.tsx +++ b/packages/fluentui/docs/src/components/ComponentDoc/ComponentControls/ComponentControls.tsx @@ -35,7 +35,7 @@ type ComponentControlsProps = { titleForAriaLabel?: string; }; -const ComponentControls: React.FC = props => { +const ComponentControls: React.FC> = props => { const { anchorName, exampleCode, diff --git a/packages/fluentui/docs/src/components/ComponentDoc/ComponentDocAccessibility.tsx b/packages/fluentui/docs/src/components/ComponentDoc/ComponentDocAccessibility.tsx index 7a7c37e82317a..c4510bddf1148 100644 --- a/packages/fluentui/docs/src/components/ComponentDoc/ComponentDocAccessibility.tsx +++ b/packages/fluentui/docs/src/components/ComponentDoc/ComponentDocAccessibility.tsx @@ -81,7 +81,7 @@ function getAllAvailableBehaviors( return _.union(behaviorVariantsWithoutDefault, otherAvailableVariants); } -export const ComponentDocAccessibility: React.FC = ({ info }) => { +export const ComponentDocAccessibility: React.FC> = ({ info }) => { const defaultBehaviorName = getDefaultBehaviorName(info); const defaultBehaviorFileName = `${_.camelCase(defaultBehaviorName)}.ts`; const description = getDescription(info); diff --git a/packages/fluentui/docs/src/components/ComponentDoc/ComponentExample/ComponentExampleColorPicker.tsx b/packages/fluentui/docs/src/components/ComponentDoc/ComponentExample/ComponentExampleColorPicker.tsx index ec102d03b194f..45988374fec06 100644 --- a/packages/fluentui/docs/src/components/ComponentDoc/ComponentExample/ComponentExampleColorPicker.tsx +++ b/packages/fluentui/docs/src/components/ComponentDoc/ComponentExample/ComponentExampleColorPicker.tsx @@ -8,7 +8,7 @@ type ComponentExampleColorPickerProps = { variableValue: string; }; -const ComponentExampleColorPicker: React.FunctionComponent = props => { +const ComponentExampleColorPicker: React.FunctionComponent> = props => { const { onChange, variableValue } = props; const { theme } = useFluentContext(); diff --git a/packages/fluentui/docs/src/components/ComponentDoc/ComponentExample/ComponentExampleVariable.tsx b/packages/fluentui/docs/src/components/ComponentDoc/ComponentExample/ComponentExampleVariable.tsx index f5a49987c938e..9a42a19c8ed7f 100644 --- a/packages/fluentui/docs/src/components/ComponentDoc/ComponentExample/ComponentExampleVariable.tsx +++ b/packages/fluentui/docs/src/components/ComponentDoc/ComponentExample/ComponentExampleVariable.tsx @@ -10,7 +10,7 @@ export type ComponentExampleVariableProps = { variableValue: string; }; -const ComponentExampleVariable: React.FunctionComponent = props => { +const ComponentExampleVariable: React.FunctionComponent> = props => { const { componentName, onChange, variableName, variableType, variableValue } = props; const handleInputChange = React.useCallback( diff --git a/packages/fluentui/docs/src/components/ComponentDoc/ComponentExample/ComponentExampleVariables.tsx b/packages/fluentui/docs/src/components/ComponentDoc/ComponentExample/ComponentExampleVariables.tsx index d7654e938dac2..f1527a15ed6ff 100644 --- a/packages/fluentui/docs/src/components/ComponentDoc/ComponentExample/ComponentExampleVariables.tsx +++ b/packages/fluentui/docs/src/components/ComponentDoc/ComponentExample/ComponentExampleVariables.tsx @@ -28,7 +28,7 @@ const getGroupName = (variableName: string): string => { return 'Other'; }; -const ComponentExampleVariables: React.FunctionComponent = props => { +const ComponentExampleVariables: React.FunctionComponent> = props => { const { onChange, overriddenVariables, usedVariables } = props; const { theme } = useFluentContext(); @@ -70,7 +70,6 @@ const ComponentExampleVariables: React.FunctionComponent setHideUnused(!data.checked)} */} {/* styles={{ float: 'right', top: '1.25rem', right: '1.25rem' }} */} {/* /> */} - {_.map(filteredVariables, (componentVariables, componentName) => { const groupedVariables: Record = _.groupBy( Object.keys(componentVariables).sort(), @@ -82,7 +81,6 @@ const ComponentExampleVariables: React.FunctionComponent {componentName} - {_.map(groupedVariables, (variableNames, groupName) => ( <>

diff --git a/packages/fluentui/docs/src/components/ComponentDoc/ComponentPerfExample/ComponentPerfExample.tsx b/packages/fluentui/docs/src/components/ComponentDoc/ComponentPerfExample/ComponentPerfExample.tsx index 3ab168e8c21e3..cc30962094207 100644 --- a/packages/fluentui/docs/src/components/ComponentDoc/ComponentPerfExample/ComponentPerfExample.tsx +++ b/packages/fluentui/docs/src/components/ComponentDoc/ComponentPerfExample/ComponentPerfExample.tsx @@ -19,7 +19,7 @@ export interface ComponentPerfExampleProps { examplePath: string; } -const ComponentPerfExample: React.FC = props => { +const ComponentPerfExample: React.FC> = props => { const { title, description, examplePath } = props; const [activeIndex, setActiveIndex] = React.useState(); diff --git a/packages/fluentui/docs/src/components/ComponentDoc/ComponentProp/ComponentPropFunctionSignature.tsx b/packages/fluentui/docs/src/components/ComponentDoc/ComponentProp/ComponentPropFunctionSignature.tsx index 8c602daba3e09..fc8a7c375d974 100644 --- a/packages/fluentui/docs/src/components/ComponentDoc/ComponentProp/ComponentPropFunctionSignature.tsx +++ b/packages/fluentui/docs/src/components/ComponentDoc/ComponentProp/ComponentPropFunctionSignature.tsx @@ -30,7 +30,7 @@ const rowStyle: any = { const getTagType = tag => (tag.type ? (tag.type.type === 'AllLiteral' ? 'any' : tag.type.name) : ''); -const ComponentPropFunctionSignature: React.SFC = ({ name, tags }) => { +const ComponentPropFunctionSignature: React.FC> = ({ name, tags }) => { const params = _.filter(tags, { title: 'param' }); const returns = _.find(tags, { title: 'returns' }); diff --git a/packages/fluentui/docs/src/components/ComponentDoc/ComponentProps/ComponentPropCard.tsx b/packages/fluentui/docs/src/components/ComponentDoc/ComponentProps/ComponentPropCard.tsx index 4727d0f0de59f..f43ac33049046 100644 --- a/packages/fluentui/docs/src/components/ComponentDoc/ComponentProps/ComponentPropCard.tsx +++ b/packages/fluentui/docs/src/components/ComponentDoc/ComponentProps/ComponentPropCard.tsx @@ -11,7 +11,7 @@ type ComponentPropCardProps = { description: string; }; -const ComponentPropCard: React.FC = ({ name, description }) => ( +const ComponentPropCard: React.FC> = ({ name, description }) => (
{description}
diff --git a/packages/fluentui/docs/src/components/ComponentDoc/ComponentPropsTable/ComponentPropsRow.tsx b/packages/fluentui/docs/src/components/ComponentDoc/ComponentPropsTable/ComponentPropsRow.tsx index 1fa4736374dcb..722ca3184a1da 100644 --- a/packages/fluentui/docs/src/components/ComponentDoc/ComponentPropsTable/ComponentPropsRow.tsx +++ b/packages/fluentui/docs/src/components/ComponentDoc/ComponentPropsTable/ComponentPropsRow.tsx @@ -11,7 +11,7 @@ const InlineMarkdown = React.lazy(() => import('../InlineMarkdown')); type ComponentPropsRowProps = ComponentProp; -const ComponentPropValue: React.FunctionComponent = props => { +const ComponentPropValue: React.FunctionComponent> = props => { const { name, parameters } = props; if (name === 'literal') return enum; @@ -43,7 +43,7 @@ const ComponentPropValue: React.FunctionComponent = props => return {name}; }; -const ComponentPropsRow: React.FunctionComponent = props => { +const ComponentPropsRow: React.FunctionComponent> = props => { const { defaultValue, description, name, required, types } = props; const shorthand = types.some(type => type.name === 'ShorthandValue' || type.name === 'ShorthandCollection'); diff --git a/packages/fluentui/docs/src/components/ComponentDoc/ComponentPropsTable/ComponentPropsTable.tsx b/packages/fluentui/docs/src/components/ComponentDoc/ComponentPropsTable/ComponentPropsTable.tsx index 6239d40ac2f30..1cae5f9741fb1 100644 --- a/packages/fluentui/docs/src/components/ComponentDoc/ComponentPropsTable/ComponentPropsTable.tsx +++ b/packages/fluentui/docs/src/components/ComponentDoc/ComponentPropsTable/ComponentPropsTable.tsx @@ -18,7 +18,7 @@ type ComponentPropsTable = { * Displays a table of a Component's PropTypes. * TODO: use Flex or a Table component, when it will be available */ -const ComponentPropsTable: React.FunctionComponent = props => { +const ComponentPropsTable: React.FunctionComponent> = props => { const componentProps = useComponentProps(props.componentName); return ( diff --git a/packages/fluentui/docs/src/components/ComponentDoc/ExampleSection.tsx b/packages/fluentui/docs/src/components/ComponentDoc/ExampleSection.tsx index 0d237886ee037..7487d2c069cc5 100644 --- a/packages/fluentui/docs/src/components/ComponentDoc/ExampleSection.tsx +++ b/packages/fluentui/docs/src/components/ComponentDoc/ExampleSection.tsx @@ -13,7 +13,7 @@ export type ExampleSectionProps = Extendable<{ }>; // minmax = prevent example overflow - https://stackoverflow.com/a/43312314 -const ExampleSection: React.FC = ({ title, children }) => ( +const ExampleSection: React.FC> = ({ title, children }) => ( <>
{title} diff --git a/packages/fluentui/docs/src/components/ComponentDoc/InlineMarkdown.tsx b/packages/fluentui/docs/src/components/ComponentDoc/InlineMarkdown.tsx index d33950446a740..3648620a2e6e7 100644 --- a/packages/fluentui/docs/src/components/ComponentDoc/InlineMarkdown.tsx +++ b/packages/fluentui/docs/src/components/ComponentDoc/InlineMarkdown.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import * as ReactMarkdown from 'react-markdown'; -const InlineMarkdown: React.FunctionComponent<{ value: string }> = ({ value }) => ( +const InlineMarkdown: React.FunctionComponent> = ({ value }) => ( {value} ); diff --git a/packages/fluentui/docs/src/components/ComponentDoc/LazyWithBabel.tsx b/packages/fluentui/docs/src/components/ComponentDoc/LazyWithBabel.tsx index f30711d5c99dc..c56e8081aa431 100644 --- a/packages/fluentui/docs/src/components/ComponentDoc/LazyWithBabel.tsx +++ b/packages/fluentui/docs/src/components/ComponentDoc/LazyWithBabel.tsx @@ -2,7 +2,7 @@ import * as React from 'react'; import useScript from '@charlietango/use-script'; import { Loader } from '@fluentui/react-northstar'; -export const LazyWithBabel: React.FunctionComponent = ({ children }) => { +export const LazyWithBabel: React.FunctionComponent> = ({ children }) => { const url = `https://cdn.jsdelivr.net/npm/@babel/standalone@${window['versions'].babelStandalone}/babel.min.js`; const [ready] = useScript(url); diff --git a/packages/fluentui/docs/src/components/ComponentDoc/NonPublicSection.tsx b/packages/fluentui/docs/src/components/ComponentDoc/NonPublicSection.tsx index 1fcf881a809c7..61b5f55a91653 100644 --- a/packages/fluentui/docs/src/components/ComponentDoc/NonPublicSection.tsx +++ b/packages/fluentui/docs/src/components/ComponentDoc/NonPublicSection.tsx @@ -1,7 +1,7 @@ import * as React from 'react'; import ExampleSection, { ExampleSectionProps } from './ExampleSection'; -const NonPublicSection: React.FC = props => { +const NonPublicSection: React.FC> = props => { return process.env.NODE_ENV === 'development' ? : null; }; diff --git a/packages/fluentui/docs/src/components/ComponentDoc/PerfChart/BundleSizeChart.tsx b/packages/fluentui/docs/src/components/ComponentDoc/PerfChart/BundleSizeChart.tsx index 4c0187bb5e668..a4d67892ba56d 100644 --- a/packages/fluentui/docs/src/components/ComponentDoc/PerfChart/BundleSizeChart.tsx +++ b/packages/fluentui/docs/src/components/ComponentDoc/PerfChart/BundleSizeChart.tsx @@ -21,7 +21,7 @@ const formatXAxis = val => { * x-axis is a build number * y-axis is a bundle size */ -const BundleSizeChart: React.FC = ({ perfData }) => { +const BundleSizeChart: React.FC> = ({ perfData }) => { const availableCharts: string[] = perfData .reduce((acc, next) => { return Array.from(new Set([...acc, ...Object.keys(next.bundleSize)])); diff --git a/packages/fluentui/docs/src/components/ComponentDoc/PerfChart/Chart.tsx b/packages/fluentui/docs/src/components/ComponentDoc/PerfChart/Chart.tsx index 3a226546ab174..b814bed0015ce 100644 --- a/packages/fluentui/docs/src/components/ComponentDoc/PerfChart/Chart.tsx +++ b/packages/fluentui/docs/src/components/ComponentDoc/PerfChart/Chart.tsx @@ -36,7 +36,7 @@ const formatXAxis = val => { return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`; }; -const Chart: React.FC = ({ perfData, yAxisLabel, group, Tooltip, dataSeries }) => { +const Chart: React.FC> = ({ perfData, yAxisLabel, group, Tooltip, dataSeries }) => { const availableCharts: string[] = perfData .reduce((acc, next) => { return Array.from(new Set([...acc, ...Object.keys(next[group])])); diff --git a/packages/fluentui/docs/src/components/ComponentDoc/PerfChart/ComponentChart.tsx b/packages/fluentui/docs/src/components/ComponentDoc/PerfChart/ComponentChart.tsx index 122e8b58f9d5f..4f106582702d1 100644 --- a/packages/fluentui/docs/src/components/ComponentDoc/PerfChart/ComponentChart.tsx +++ b/packages/fluentui/docs/src/components/ComponentDoc/PerfChart/ComponentChart.tsx @@ -12,7 +12,7 @@ enum FILTER_BY { export type ComponentChartProps = { chartData; Filter?; Chart }; -const ComponentChart: React.FunctionComponent = ({ chartData, Filter, Chart }) => { +const ComponentChart: React.FunctionComponent> = ({ chartData, Filter, Chart }) => { const { loading, error, data } = chartData; const [filterBy, setFilterBy] = React.useState(FILTER_BY.CI_BUILD); diff --git a/packages/fluentui/docs/src/components/ComponentDoc/PerfChart/PerfChart.tsx b/packages/fluentui/docs/src/components/ComponentDoc/PerfChart/PerfChart.tsx index fa2f39ed7a340..08b5bcb7f08f1 100644 --- a/packages/fluentui/docs/src/components/ComponentDoc/PerfChart/PerfChart.tsx +++ b/packages/fluentui/docs/src/components/ComponentDoc/PerfChart/PerfChart.tsx @@ -20,7 +20,7 @@ const medColor = '#555555'; const tpiColor = '#387fc2'; const minColor = '#59b359'; -const PerfChart: React.FC = ({ perfData, filter }) => { +const PerfChart: React.FC> = ({ perfData, filter }) => { const dataSeries: ChartDataSeries[] = [ filter?.extremes && { name: 'max', diff --git a/packages/fluentui/docs/src/components/ComponentDoc/PerfChart/PerfDataProvider.tsx b/packages/fluentui/docs/src/components/ComponentDoc/PerfChart/PerfDataProvider.tsx index 7469fc583e35b..b6a5f5ad63304 100644 --- a/packages/fluentui/docs/src/components/ComponentDoc/PerfChart/PerfDataProvider.tsx +++ b/packages/fluentui/docs/src/components/ComponentDoc/PerfChart/PerfDataProvider.tsx @@ -11,7 +11,7 @@ import config from '../../../config'; * [ ] refresh support * [ ] serve static data in public builds */ -const PerfDataProvider: React.FC = ({ children }) => { +const PerfDataProvider: React.FC> = ({ children }) => { const [loading, setLoading] = React.useState(true); const [error, setError] = React.useState(); const [data, setData] = React.useState(); diff --git a/packages/fluentui/docs/src/components/ComponentDoc/PerfChart/ResourcesChart.tsx b/packages/fluentui/docs/src/components/ComponentDoc/PerfChart/ResourcesChart.tsx index da086906f0d91..f4efe579b437d 100644 --- a/packages/fluentui/docs/src/components/ComponentDoc/PerfChart/ResourcesChart.tsx +++ b/packages/fluentui/docs/src/components/ComponentDoc/PerfChart/ResourcesChart.tsx @@ -23,7 +23,7 @@ function intToRGB(i) { return '00000'.substring(0, 6 - c.length) + c; } -const ResourcesChart: React.FC = ({ perfData, filter = [] }) => { +const ResourcesChart: React.FC> = ({ perfData, filter = [] }) => { const dataSeries: ChartDataSeries[] = filter.map(d => ({ name: d, data: `flamegrill.profile.metrics.${d}`, diff --git a/packages/fluentui/docs/src/components/ComponentDoc/PrototypePerfExample/PrototypePerfControls.tsx b/packages/fluentui/docs/src/components/ComponentDoc/PrototypePerfExample/PrototypePerfControls.tsx index 51fc95359bab9..5583e7ebf798d 100644 --- a/packages/fluentui/docs/src/components/ComponentDoc/PrototypePerfExample/PrototypePerfControls.tsx +++ b/packages/fluentui/docs/src/components/ComponentDoc/PrototypePerfExample/PrototypePerfControls.tsx @@ -9,7 +9,7 @@ export interface PrototypeExampleControlsProps { examplePath: string; } -const PrototypeExampleControls: React.FC = props => { +const PrototypeExampleControls: React.FC> = props => { const items = [ { icon: , diff --git a/packages/fluentui/docs/src/components/ComponentDoc/PrototypePerfExample/PrototypePerfExample.tsx b/packages/fluentui/docs/src/components/ComponentDoc/PrototypePerfExample/PrototypePerfExample.tsx index ef10c0c6b8885..d66433836d6f6 100644 --- a/packages/fluentui/docs/src/components/ComponentDoc/PrototypePerfExample/PrototypePerfExample.tsx +++ b/packages/fluentui/docs/src/components/ComponentDoc/PrototypePerfExample/PrototypePerfExample.tsx @@ -22,7 +22,7 @@ export interface PrototypePerfExampleProps { examplePath: string; } -const PrototypePerfExample: React.FC = props => { +const PrototypePerfExample: React.FC> = props => { const { title, description, examplePath } = props; const Prototype = React.lazy(async () => ({ diff --git a/packages/fluentui/docs/src/components/ComponentDoc/SourceRender.tsx b/packages/fluentui/docs/src/components/ComponentDoc/SourceRender.tsx index 460eb641b1d9a..b9311cadf4c0c 100644 --- a/packages/fluentui/docs/src/components/ComponentDoc/SourceRender.tsx +++ b/packages/fluentui/docs/src/components/ComponentDoc/SourceRender.tsx @@ -12,7 +12,7 @@ type SourceRenderProps = { onRender?: (error: Error | null) => void; }; -export const SourceRender: React.FC = props => ( +export const SourceRender: React.FC> = props => ( <_SourceRender {...props} /> diff --git a/packages/fluentui/docs/src/components/ComponentPlayground/ComponentPlayground.tsx b/packages/fluentui/docs/src/components/ComponentPlayground/ComponentPlayground.tsx index 62d082fac96de..0332e30c57678 100644 --- a/packages/fluentui/docs/src/components/ComponentPlayground/ComponentPlayground.tsx +++ b/packages/fluentui/docs/src/components/ComponentPlayground/ComponentPlayground.tsx @@ -32,7 +32,7 @@ const unsupportedComponents = [ 'Ref', ]; -const ComponentPlayground: React.FunctionComponent = props => { +const ComponentPlayground: React.FunctionComponent> = props => { if (unsupportedComponents.indexOf(props.componentName) !== -1) { return null; } @@ -43,7 +43,7 @@ const ComponentPlayground: React.FunctionComponent = p ); if (playgroundPath) { - const component: React.FC = examplePlaygroundContext(playgroundPath).default; + const component: React.FC> = examplePlaygroundContext(playgroundPath).default; return ; } @@ -74,7 +74,7 @@ const ComponentPlayground: React.FunctionComponent = p export default props => ( /* KnobProvider should be defined outside otherwise hooks will not properly register */ - + ( - + ) ); diff --git a/packages/fluentui/docs/src/components/ComponentPlayground/ComponentPlaygroundSnippet.tsx b/packages/fluentui/docs/src/components/ComponentPlayground/ComponentPlaygroundSnippet.tsx index 756140f551439..7fc69d8dc2d55 100644 --- a/packages/fluentui/docs/src/components/ComponentPlayground/ComponentPlaygroundSnippet.tsx +++ b/packages/fluentui/docs/src/components/ComponentPlayground/ComponentPlaygroundSnippet.tsx @@ -3,13 +3,13 @@ import * as React from 'react'; type ComponentPlaygroundSnippetProps = { element?: React.ReactElement; - component?: React.FunctionComponent; + component?: React.FunctionComponent>; } & Partial; /** * This component uses `react-element-to-jsx-string` to get a generated markup with props. */ -const ComponentPlaygroundSnippet: React.FunctionComponent = props => { +const ComponentPlaygroundSnippet: React.FunctionComponent> = props => { const { element, component, ...rest } = props; if (process.env.NODE_ENV !== 'production') { diff --git a/packages/fluentui/docs/src/components/ComponentPlayground/ComponentPlaygroundTemplate.tsx b/packages/fluentui/docs/src/components/ComponentPlayground/ComponentPlaygroundTemplate.tsx index dd4d9a95d5d7d..ea0110a33f6ab 100644 --- a/packages/fluentui/docs/src/components/ComponentPlayground/ComponentPlaygroundTemplate.tsx +++ b/packages/fluentui/docs/src/components/ComponentPlayground/ComponentPlaygroundTemplate.tsx @@ -7,18 +7,18 @@ import ComponentPlaygroundSnippet from './ComponentPlaygroundSnippet'; type ComponentPlaygroundTemplateProps = { element?: React.ReactElement; - component?: React.FunctionComponent; + component?: React.FunctionComponent>; fluid?: boolean; }; -const NoopKnobProvider: React.FunctionComponent = props => { +const NoopKnobProvider: React.FunctionComponent> = props => { const knobContext = React.useContext(unstable_KnobContext); const noopContext = { ...knobContext, registerKnob: _.noop, unregisterKnob: _.noop }; return {props.children}; }; -const ComponentPlaygroundTemplate: React.FunctionComponent = props => ( +const ComponentPlaygroundTemplate: React.FunctionComponent> = props => ( = props => { +const ExampleSnippet: React.FunctionComponent> = props => { const { children, render = () => null, value } = props; const child: React.ReactElement | null = render() || children; diff --git a/packages/fluentui/docs/src/components/ExternalExampleLayout.tsx b/packages/fluentui/docs/src/components/ExternalExampleLayout.tsx index c885abc3b1876..c342b98d16388 100644 --- a/packages/fluentui/docs/src/components/ExternalExampleLayout.tsx +++ b/packages/fluentui/docs/src/components/ExternalExampleLayout.tsx @@ -33,7 +33,7 @@ const themes = { teamsDarkV2: teamsDarkV2Theme, }; -const ExternalExampleLayout: React.FC = props => { +const ExternalExampleLayout: React.FC> = props => { const { exampleName, rtl } = props.match.params; const [renderId, setRenderId] = React.useState(0); diff --git a/packages/fluentui/docs/src/components/GuidesNavigationFooter.tsx b/packages/fluentui/docs/src/components/GuidesNavigationFooter.tsx index 5b990ffe3f63b..cf5f99cce1e95 100644 --- a/packages/fluentui/docs/src/components/GuidesNavigationFooter.tsx +++ b/packages/fluentui/docs/src/components/GuidesNavigationFooter.tsx @@ -13,7 +13,7 @@ type GuidesNavigationFooterProps = { next?: PageDescriptor; }; -const GuidesNavigationFooter: React.FC = ({ previous, next }) => ( +const GuidesNavigationFooter: React.FC> = ({ previous, next }) => ( <>
diff --git a/packages/fluentui/docs/src/components/Logo/Logo.tsx b/packages/fluentui/docs/src/components/Logo/Logo.tsx index 19dcd32e68ed8..1b81846d5783c 100644 --- a/packages/fluentui/docs/src/components/Logo/Logo.tsx +++ b/packages/fluentui/docs/src/components/Logo/Logo.tsx @@ -5,7 +5,7 @@ export type LogoProps = ImageProps & { flavor?: 'black' | 'white' | 'inverted'; }; -const Logo: React.SFC = ({ flavor, ...props }) => ( +const Logo: React.FC> = ({ flavor, ...props }) => ( ; + default: React.ComponentType>; meta: { previous?: PageDescriptor; next?: PageDescriptor; @@ -51,7 +51,7 @@ const components = { img: props => , }; -const MarkdownPage: React.FunctionComponent = props => { +const MarkdownPage: React.FunctionComponent> = props => { const { page } = props; const { default: Component, meta } = page; diff --git a/packages/fluentui/docs/src/components/Sidebar/Sidebar.tsx b/packages/fluentui/docs/src/components/Sidebar/Sidebar.tsx index f84e0d12505c5..d448d36b6de59 100644 --- a/packages/fluentui/docs/src/components/Sidebar/Sidebar.tsx +++ b/packages/fluentui/docs/src/components/Sidebar/Sidebar.tsx @@ -359,7 +359,7 @@ const getSectionsWithPrototypeSectionIfApplicable = (currentSections, allPrototy return currentSections.concat(prototypeTreeSection); }; -const Sidebar: React.FC = props => { +const Sidebar: React.FC> = props => { const [query, setQuery] = React.useState(''); const [activeItemIds, setActiveItemIds] = React.useState([]); const searchInputRef = React.useRef(); diff --git a/packages/fluentui/docs/src/components/SystemColors.tsx b/packages/fluentui/docs/src/components/SystemColors.tsx index 105372a8bd1f6..bb8822be5c868 100644 --- a/packages/fluentui/docs/src/components/SystemColors.tsx +++ b/packages/fluentui/docs/src/components/SystemColors.tsx @@ -3,7 +3,7 @@ import { Grid } from '@fluentui/react-northstar'; import ColorBox from './ColorBox'; import { systemColors } from '../utils'; -const SystemColors: React.FC = () => { +const SystemColors: React.FC> = () => { return ( {systemColors.map(color => ( diff --git a/packages/fluentui/docs/src/components/VariableResolver/VariableResolver.tsx b/packages/fluentui/docs/src/components/VariableResolver/VariableResolver.tsx index 56d09788c4c10..b68430b619af5 100644 --- a/packages/fluentui/docs/src/components/VariableResolver/VariableResolver.tsx +++ b/packages/fluentui/docs/src/components/VariableResolver/VariableResolver.tsx @@ -9,7 +9,7 @@ type VariableResolverProps = { onResolve: (variables: Record) => void; }; -const VariableResolver: React.FunctionComponent = props => { +const VariableResolver: React.FunctionComponent> = props => { const { onResolve } = props; const elementRef = React.useRef(); diff --git a/packages/fluentui/docs/src/examples/components/Accordion/BestPractices/AccordionBestPractices.tsx b/packages/fluentui/docs/src/examples/components/Accordion/BestPractices/AccordionBestPractices.tsx index 9608f3f6ffec3..63b752882fb18 100644 --- a/packages/fluentui/docs/src/examples/components/Accordion/BestPractices/AccordionBestPractices.tsx +++ b/packages/fluentui/docs/src/examples/components/Accordion/BestPractices/AccordionBestPractices.tsx @@ -7,7 +7,7 @@ const doList = [ 'Use Tree component to display a hierarchical structure that allows user to select one item.', ]; -const AccordionBestPractices: React.FunctionComponent<{}> = () => { +const AccordionBestPractices: React.FunctionComponent> = () => { return ; }; diff --git a/packages/fluentui/docs/src/examples/components/Breadcrumb/BestPractices/BreadcrumbBestPractices.tsx b/packages/fluentui/docs/src/examples/components/Breadcrumb/BestPractices/BreadcrumbBestPractices.tsx index 6ac41c34b6200..d869b55f93acb 100644 --- a/packages/fluentui/docs/src/examples/components/Breadcrumb/BestPractices/BreadcrumbBestPractices.tsx +++ b/packages/fluentui/docs/src/examples/components/Breadcrumb/BestPractices/BreadcrumbBestPractices.tsx @@ -16,7 +16,7 @@ const doList = [ const dontList = ["Don't use Breadcrumbs as a primary way to navigate an app or site."]; -const BreadcrumbBestPractices: React.FunctionComponent<{}> = () => { +const BreadcrumbBestPractices: React.FunctionComponent> = () => { return ; }; diff --git a/packages/fluentui/docs/src/examples/components/Button/BestPractices/ButtonBestPractices.tsx b/packages/fluentui/docs/src/examples/components/Button/BestPractices/ButtonBestPractices.tsx index 414aa96bf4879..02a3db6f6de4d 100644 --- a/packages/fluentui/docs/src/examples/components/Button/BestPractices/ButtonBestPractices.tsx +++ b/packages/fluentui/docs/src/examples/components/Button/BestPractices/ButtonBestPractices.tsx @@ -14,7 +14,7 @@ const doList = [ , ]; -const ButtonBestPractices: React.FunctionComponent<{}> = () => { +const ButtonBestPractices: React.FunctionComponent> = () => { return ; }; diff --git a/packages/fluentui/docs/src/examples/components/Button/Variations/ButtonExampleSize.shorthand.tsx b/packages/fluentui/docs/src/examples/components/Button/Variations/ButtonExampleSize.shorthand.tsx index f9b1883de0dbe..c90ad55249371 100644 --- a/packages/fluentui/docs/src/examples/components/Button/Variations/ButtonExampleSize.shorthand.tsx +++ b/packages/fluentui/docs/src/examples/components/Button/Variations/ButtonExampleSize.shorthand.tsx @@ -1,7 +1,7 @@ import { Button, Divider, Flex } from '@fluentui/react-northstar'; import * as React from 'react'; -const ButtonExampleSizeShorthand: React.FC = () => ( +const ButtonExampleSizeShorthand: React.FC> = () => ( <>