Skip to content

Commit

Permalink
Bump React to ^18.3.1 (#387)
Browse files Browse the repository at this point in the history
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Michał Dudak <[email protected]>
  • Loading branch information
renovate[bot] and michaldudak authored Aug 1, 2024
1 parent fa9f3fa commit eb4c4bb
Show file tree
Hide file tree
Showing 6 changed files with 252 additions and 269 deletions.
6 changes: 3 additions & 3 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,10 @@
"postcss": "^8.4.40",
"postcss-import": "^16.1.0",
"prop-types": "^15.8.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"react-draggable": "^4.4.6",
"react-is": "^18.2.0",
"react-is": "^18.3.1",
"react-router-dom": "^6.23.1",
"react-runner": "^1.0.5",
"react-simple-code-editor": "^0.13.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/mui-base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@
"chai": "^4.4.1",
"fast-glob": "^3.3.2",
"lodash": "^4.17.21",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"sinon": "^17.0.1",
"typescript": "^5.4.5"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,9 @@ describe('useAutocomplete', () => {
{groupedOptions.length > 0 ? (
<ul {...getListboxProps()}>
{groupedOptions.map((option, index) => {
const { key, ...other } = getOptionProps({ option, index });
const { key, ...optionProps } = getOptionProps({ option, index });
return (
<li key={key} {...other}>
<li key={key} {...optionProps}>
{option}
</li>
);
Expand All @@ -277,52 +277,28 @@ describe('useAutocomplete', () => {
}

const node16ErrorMessage =
"TypeError: Cannot read properties of null (reading 'removeAttribute')";
const olderNodeErrorMessage = "TypeError: Cannot read property 'removeAttribute' of null";
"Error: Uncaught [TypeError: Cannot read properties of null (reading 'removeAttribute')]";
const olderNodeErrorMessage =
"Error: Uncaught [TypeError: Cannot read property 'removeAttribute' of null]";

const nodeVersion = Number(process.versions.node.split('.')[0]);
const errorMessage = nodeVersion >= 16 ? node16ErrorMessage : olderNodeErrorMessage;

const wrappedErrorMessage = `Error: Uncaught [${errorMessage}]`;

const react17ErrorMessages = [
wrappedErrorMessage,
'MUI: Unable to find the input element.',
wrappedErrorMessage,
'The above error occurred in the <ul> component',
'The above error occurred in the <Test> component',
];

const react182ErrorMessages = [
wrappedErrorMessage,
const devErrorMessages = [
errorMessage,
'MUI: Unable to find the input element.',
wrappedErrorMessage,
errorMessage,
// strict effects runs effects twice
'MUI: Unable to find the input element.',
wrappedErrorMessage,
React.version.startsWith('18') && 'MUI: Unable to find the input element.',
React.version.startsWith('18') && errorMessage,
'The above error occurred in the <ul> component',
React.version.startsWith('16') && 'The above error occurred in the <ul> component',
'The above error occurred in the <Test> component',
// strict effects runs effects twice
'The above error occurred in the <Test> component',
];

const react183ErrorMessages = [
'MUI: Unable to find the input element.',
'MUI: Unable to find the input element.',
errorMessage,
errorMessage,
errorMessage,
React.version.startsWith('18') && 'The above error occurred in the <Test> component',
React.version.startsWith('16') && 'The above error occurred in the <Test> component',
];

let devErrorMessages;
if (React.version.startsWith('18.3')) {
devErrorMessages = react183ErrorMessages;
} else if (React.version.startsWith('18')) {
devErrorMessages = react182ErrorMessages;
} else {
devErrorMessages = react17ErrorMessages;
}

expect(() => {
render(
<ErrorBoundary>
Expand Down
Loading

0 comments on commit eb4c4bb

Please sign in to comment.