Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
a3cc0aa
chore: bump react to v18 and types
mainframev Mar 17, 2025
59102de
chore(react-utilities): slot API react v17/18 support
bsunderhus Jun 6, 2024
0a3140d
chore: deprecates ComponentState.components property
bsunderhus Jun 7, 2024
98ecca5
chore(react-utilities): updates useMergedRefs to accept LegacyRef
bsunderhus Jun 7, 2024
00fd8b6
chore: loosen types for deprecated API
bsunderhus Jun 10, 2024
cdb465a
chore: updates getSlotsNext tests
bsunderhus Jun 11, 2024
3beb02e
chore: modifications to support motion
bsunderhus Jul 25, 2024
e4dcfdd
chore: ReactRefCompat
bsunderhus Jul 26, 2024
957465f
chore: redeclare RefAttributes instead of supporting LegacyRef
bsunderhus Jul 27, 2024
8b75c28
chore: keep render function on root signature
bsunderhus Aug 16, 2024
0836728
chore(react-utilities): export PropsWithoutRef and PropsWithoutChildr…
mainframev Feb 26, 2025
413bceb
chore: fix lint deprecation lint errors
mainframev Feb 26, 2025
8d4b781
chore(react-utilities): export RefAttributes type
mainframev Mar 3, 2025
597066f
chore: dedupe
mainframev Mar 18, 2025
bf40f8b
chore: remove redundant as assertions
mainframev Mar 17, 2025
b4287da
chore: resolve useCallback implicit any issues
mainframev Mar 17, 2025
480a804
fix: fix issues with react 18 types and implicit children
mainframev Mar 18, 2025
53bcfc5
fix(docs): fix type issues related to React 18
mainframev Mar 19, 2025
4123d01
fix(storybook): fix missing implicit children in React.FC
mainframev Mar 19, 2025
29377e4
chore(react-experiments): resolve issues with React 18 migration
mainframev Mar 21, 2025
f4cf108
chore(react-docsite-components): resolve issues related to React 18 t…
mainframev Mar 21, 2025
af74d8d
chore(react-components): resolve issues related to React 18 types
mainframev Mar 21, 2025
36688ed
chore(charts): update testing-library to support React 18
mainframev Mar 21, 2025
6d0db7c
chore(react-cards): resolve issues related to React 18 types
mainframev Mar 21, 2025
e8fc4fc
chore(react-monaco-editor): resolve issues related to React 18 types
mainframev Mar 21, 2025
9a5c0e1
chore(react-focus): resolve errors related to React 18 types
mainframev Mar 21, 2025
eae409e
chore(vr-test-app): add children to React.FC
mainframev Mar 21, 2025
c50458e
chore(FluentDocsContainer): add missing children type
mainframev Mar 26, 2025
4822170
chore(v0): resolve issues with React 18 types
mainframev Mar 26, 2025
dff65e2
chore(v8-react-example): handle React 18 type issues
mainframev Mar 30, 2025
cad902b
chore: udpate react-is
mainframev Mar 31, 2025
823b22c
chore: dedupe
mainframev Mar 31, 2025
e2deac3
chore(v8): handle issues with React 18 in v8
mainframev Mar 31, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -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<FluentDocsContainerProps> = ({ children, context }) => {
export const FluentDocsContainer: React.FC<React.PropsWithChildren<FluentDocsContainerProps>> = ({
children,
context,
}) => {
return (
<>
{/** TODO add table of contents */}
Expand Down
2 changes: 1 addition & 1 deletion apps/react-18-tests-v8/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
6 changes: 3 additions & 3 deletions apps/react-18-tests-v9/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: slot API react v17/18 support",
"packageName": "@fluentui/react-aria",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: slot API react v17/18 support",
"packageName": "@fluentui/react-datepicker-compat",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "\u0002chore: slot API react v17/18 support",
"packageName": "@fluentui/react-dialog",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: deprecates ComponentState.components property",
"packageName": "@fluentui/react-drawer",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: slot API react v17/18 support",
"packageName": "@fluentui/react-jsx-runtime",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: slot API react v17/18 support",
"packageName": "@fluentui/react-menu",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: slot API react v17/18 support",
"packageName": "@fluentui/react-migration-v0-v9",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: slot API react v17/18 support",
"packageName": "@fluentui/react-migration-v8-v9",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: slot API react v17/18 support",
"packageName": "@fluentui/react-motion",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: deprecates ComponentState.components property",
"packageName": "@fluentui/react-search",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: slot API react v17/18 support",
"packageName": "@fluentui/react-table",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: slot API react v17/18 support",
"packageName": "@fluentui/react-tabs",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: deprecates ComponentState.components property",
"packageName": "@fluentui/react-tag-picker",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: slot API react v17/18 support",
"packageName": "@fluentui/react-toast",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "patch",
"comment": "chore: slot API react v17/18 support",
"packageName": "@fluentui/react-toolbar",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "minor",
"comment": "chore: slot API react v17/18 support",
"packageName": "@fluentui/react-utilities",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "chore: deprecates ComponentState.components property",
"packageName": "@fluentui/react-virtualizer",
"email": "[email protected]",
"dependentChangeType": "patch"
}
27 changes: 13 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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": []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ export const ResponsiveContainer: React.FC<IResponsiveContainerProps> = 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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions packages/charts/react-charting/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion packages/fluentui/code-sandbox/src/SandboxApp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const themes = {
teamsHighContrastTheme,
};

export const SandboxApp: React.FunctionComponent = props => {
export const SandboxApp: React.FunctionComponent<React.PropsWithChildren<unknown>> = props => {
const { children } = props;
const [theme, setTheme] = React.useState(items[0].value);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const copyIcon = (
</svg>
);

export const CodeSnippetLabel: React.FunctionComponent<CopySnippetLabelProps> = props => {
export const CodeSnippetLabel: React.FunctionComponent<React.PropsWithChildren<CopySnippetLabelProps>> = props => {
const { copyable, label, mode, value } = props;
const hasLabel = label !== false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type KnobProviderProps = {
components?: Partial<KnobComponents>;
};

export const KnobProvider: React.FunctionComponent<KnobProviderProps> = props => {
export const KnobProvider: React.FunctionComponent<React.PropsWithChildren<KnobProviderProps>> = props => {
const { children, components } = props;

const [knobs, setKnobs] = React.useState<KnobSet>({});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ type LogInspectorProps = {
silent?: boolean;
};

export const LogInspector: React.FunctionComponent<LogInspectorProps> = props => {
export const LogInspector: React.FunctionComponent<React.PropsWithChildren<LogInspectorProps>> = props => {
const { components } = React.useContext(KnobContext);

const { clearLog } = React.useContext(LogContextFunctions);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
} from './types';
import { parseValue } from './utils/parseRangeValue';

const KnobField: React.FunctionComponent<KnobComponentProps> = props => (
const KnobField: React.FunctionComponent<React.PropsWithChildren<KnobComponentProps>> = props => (
<div
style={{
borderBottom: '1px solid rgb(234, 234, 234)',
Expand All @@ -22,7 +22,7 @@ const KnobField: React.FunctionComponent<KnobComponentProps> = props => (
</div>
);

const KnobControl: React.FunctionComponent<KnobComponentProps> = props => (
const KnobControl: React.FunctionComponent<React.PropsWithChildren<KnobComponentProps>> = props => (
<span
style={{
verticalAlign: 'middle',
Expand All @@ -34,13 +34,13 @@ const KnobControl: React.FunctionComponent<KnobComponentProps> = props => (
</span>
);

const KnobLabel: React.FunctionComponent<KnobComponentProps> = props => (
const KnobLabel: React.FunctionComponent<React.PropsWithChildren<KnobComponentProps>> = props => (
<label htmlFor={`knob_${props.name}`} style={{ marginRight: 5 }}>
{props.content || <code>{props.name}</code>}
</label>
);

const KnobBoolean: React.FunctionComponent<KnobComponentProps> = props => (
const KnobBoolean: React.FunctionComponent<React.PropsWithChildren<KnobComponentProps>> = props => (
<input
id={`knob_${props.name}`}
checked={props.value}
Expand All @@ -52,7 +52,7 @@ const KnobBoolean: React.FunctionComponent<KnobComponentProps> = props => (
/>
);

const KnobNumber: React.FunctionComponent<KnobNumberKnobComponentProps> = props => (
const KnobNumber: React.FunctionComponent<React.PropsWithChildren<KnobNumberKnobComponentProps>> = props => (
<input
id={`knob_${props.name}`}
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
Expand All @@ -76,7 +76,7 @@ const KnobNumber: React.FunctionComponent<KnobNumberKnobComponentProps> = props
/>
);

const KnobSelect: React.FunctionComponent<KnobComponentProps> = props => (
const KnobSelect: React.FunctionComponent<React.PropsWithChildren<KnobComponentProps>> = props => (
<select
id={`knob_${props.name}`}
onChange={(e: React.ChangeEvent<HTMLSelectElement>) => {
Expand All @@ -94,7 +94,7 @@ const KnobSelect: React.FunctionComponent<KnobComponentProps> = props => (
</select>
);

const KnobRange: React.FunctionComponent<KnobRangeKnobComponentProps> = props => (
const KnobRange: React.FunctionComponent<React.PropsWithChildren<KnobRangeKnobComponentProps>> = props => (
<input
id={`knob_${props.name}`}
type="range"
Expand All @@ -109,7 +109,7 @@ const KnobRange: React.FunctionComponent<KnobRangeKnobComponentProps> = props =>
/>
);

const KnobString: React.FunctionComponent<KnobComponentProps> = props => (
const KnobString: React.FunctionComponent<React.PropsWithChildren<KnobComponentProps>> = props => (
<input
id={`knob_${props.name}`}
onChange={(e: React.ChangeEvent<HTMLInputElement>) => {
Expand All @@ -120,7 +120,7 @@ const KnobString: React.FunctionComponent<KnobComponentProps> = props => (
/>
);

const LogInspector: React.FunctionComponent<LogInspectorProps> = props => (
const LogInspector: React.FunctionComponent<React.PropsWithChildren<LogInspectorProps>> = props => (
<>
<div style={{ display: 'flex', padding: 5 }}>
<div style={{ flexGrow: 1 }}>
Expand Down
Loading