#37730·material-ui

[docs] Passing sx example causes eslint "unsafe spready of 'any' value in an array" error

Author: tylersouthardCreated Jun 26, 2023Updated Sep 3, 2026
Labelsdocsscope: systemhas workaround

Duplicates

  • I have searched the existing issues

Related page

https://mui.com/system/getting-started/the-sx-prop/#passing-the-sx-prop

Kind of issue

Broken demonstration

Issue description

Perhaps the expectation is that users are not prohibiting the use of the any type via eslint, but if I copy the ListHeader component example from the referenced docs page, eslint marks it as an error. Specifically, the case where sx is an array, eslint sees it as type any[] (see screenshot). I'm wondering if there's a way to make this work with the eslint setting to prevent the use of any?

Context

Attempting to make a component that accepts an sx property and passes it to its first child component (a MUI Box) and add a few style prop settings. See screenshot.