Skip to content

[internal] Improve React 19 support#16048

Merged
LukasTy merged 30 commits intomui:v7.xfrom
LukasTy:cherry-pick-15769
Jan 2, 2025
Merged

[internal] Improve React 19 support#16048
LukasTy merged 30 commits intomui:v7.xfrom
LukasTy:cherry-pick-15769

Conversation

@LukasTy
Copy link
Member

@LukasTy LukasTy commented Dec 31, 2024

Cherry-pick #15769.

  • Introduce new changes and different fixes appropriate to v7 to avoid TS issues.
  • Bump certain dependencies to avoid duplications after bumping @mui/internal-test-utils
    • @testing-library/react, sinon, jsdom, mocha

renovate bot and others added 12 commits December 31, 2024 15:57
Signed-off-by: Armin Mehinovic <4390250+arminmeh@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Jose Quintas <juniorquintas@gmail.com>
Co-authored-by: Lukas <llukas.tyla@gmail.com>
Co-authored-by: flavien <flaviendelangle@gmail.com>
Co-authored-by: Armin Mehinovic <armin@mui.com>
Co-authored-by: Armin Mehinovic <4390250+arminmeh@users.noreply.github.com>
Co-authored-by: Bilal Shafi <bilalshafidev@gmail.com>
@LukasTy LukasTy added internal Behind-the-scenes enhancement. Formerly called “core”. dependencies Update of dependencies. React 19 support labels Dec 31, 2024
@LukasTy LukasTy self-assigned this Dec 31, 2024
@LukasTy LukasTy added the cherry-pick The PR was cherry-picked from the newer alpha/beta/stable branch. label Dec 31, 2024
@mui-bot
Copy link

mui-bot commented Dec 31, 2024

Deploy preview: https://deploy-preview-16048--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against cad51b6

const drawingArea = useDrawingArea(); // Get the dimensions of the chart inside the <svg/>.

if (!tooltipData || !mousePosition) {
if (!tooltipData || !mousePosition || !svgRef.current) {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is unique to v7.

tooltipData.identifier.dataIndex === undefined ||
tooltipData.value === null
tooltipData.value === null ||
svgRef.current === null
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is unique to v7.

if (svgRef.current === null) {
return undefined;
}
const element = svgRef.current;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This basically replicated the situation in master to avoid the element being | null below.

skipAnimation
slots={slots}
slotProps={slotProps}
sx={{ shapeRendering: 'auto' }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works on v7, but is once again an unknown prop. 🤔 🙈
How do you want to handle it for v7 @mui/xcharts?
Reference for v8/master: https://github.com/mui/mui-x/pull/15769/files#r1892161016

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JCQuintas WDYT about this case?
For v7 this is a tiny behavior change as sx works. 🤔
Maybe we should just ignore this line on v7 to avoid unwanted changes. 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just remove is ok, doesn't affect visual it seems

export interface DrawingProviderProps extends LayoutConfig {
children: React.ReactNode;
svgRef: React.RefObject<SVGSVGElement>;
svgRef: React.RefObject<SVGSVGElement | null>;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes are unique to v7.

@JCQuintas
Copy link
Member

@LukasTy charts are not working on the preview. I guess some of the changes broke it. I'll eventually check it this week 😆

@JCQuintas
Copy link
Member

Why argos has a lot of changes and additions? 🤔

@LukasTy
Copy link
Member Author

LukasTy commented Jan 2, 2025

Why argos has a lot of changes and additions? 🤔

It might have been a flaky run/diff on Argos side. 🤔
Will retry.

@LukasTy
Copy link
Member Author

LukasTy commented Jan 2, 2025

Why argos has a lot of changes and additions? 🤔

It might have been a flaky run/diff on Argos side. 🤔 Will retry.

@JCQuintas it could have been produced by the run on react 18.3.1. 🙈
The latest run is still flaky on 2 tests, rerunning once more. 👍

@LukasTy LukasTy merged commit 707a652 into mui:v7.x Jan 2, 2025
@LukasTy LukasTy deleted the cherry-pick-15769 branch January 2, 2025 09:19
@oliviertassinari oliviertassinari changed the title [core] Improve React 19 support [internal] Improve React 19 support Feb 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cherry-pick The PR was cherry-picked from the newer alpha/beta/stable branch. dependencies Update of dependencies. internal Behind-the-scenes enhancement. Formerly called “core”.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants