mui / mui/material-ui

sx prop triggers re-render

Open
#48,235 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

performance v9.x
Dominant language
JavaScript
Stars
99.1k
Forks
32.5k
Avg merge
2d 17h
Merged PRs (30d)
106

Description

In Version 9 a lot of system props we used got removed. And (according to the upgrade guide) sx seems to be the new way to go. But wouldn't adding an inline object to the sx prop trigger a re-render on child components every time. Even when the children are pure. We have a large codebase with tousands of components and a lot of lists and deep structures. Are we now forced to use useMemo or create stable objects for each and every sx prop?

Search keywords:

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the upgrade guide's sx section and the issue's inline-object re-render question. Determine whether inline sx objects affect pure child components and whether stable objects are required; done means providing a concrete, documented answer for large lists and deep component trees.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
frontend
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.