Duplicates
Latest version
Current behavior 😯
When writing the direction prop as array, any spacing css margin prop will be rendered with a postfix undefined. This is not the case when direction is written as object
Expected behavior 🤔
that direction in array notation doesn't break the spacing calculation
Steps to reproduce 🕹
Steps:
- create
<Stack direction={['row', 'column-reverse']} spacing={2}>
<Item>Item 1</Item>
<Item>Item 2</Item>
<Item>Item 3</Item>
</Stack>
- Note that there is no spacing
- in the dev tool the
margin property contains an undefined

with object notation this is working:

Context 🔦
I have a dialog with dialog action buttons. For mobile, I want to stack them vertically, otherwise horizontally. (I know screenshot shows otherwise 😉 )
Your environment 🌎
`npx @mui/envinfo`
System:
OS: macOS 12.3.1
Binaries:
Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node
Yarn: 1.22.18 - ~/.nvm/versions/node/v16.14.2/bin/yarn
npm: 8.5.0 - ~/.nvm/versions/node/v16.14.2/bin/npm
Browsers:
Chrome: 100.0.4896.75
Edge: Not Found
Firefox: 98.0.2
Safari: 15.4
npmPackages:
@emotion/react: 11.8.2 => 11.8.2
@emotion/styled: 11.8.1 => 11.8.1
@mui/icons-material: 5.5.1 => 5.5.1
@mui/material: 5.5.3 => 5.5.3
@mui/system: 5.5.3 => 5.5.3
@mui/utils: 5.6.0
@types/react: 17.0.16 => 17.0.16
react: 17.0.2 => 17.0.2
react-dom: 17.0.2 => 17.0.2
styled-components: 5.3.5 => 5.3.5
typescript: 4.6.3 => 4.6.3
Duplicates
Latest version
Current behavior 😯
When writing the
directionprop as array, any spacing css margin prop will be rendered with a postfixundefined. This is not the case whendirectionis written as objectExpected behavior 🤔
that
directionin array notation doesn't break thespacingcalculationSteps to reproduce 🕹
Steps:
marginproperty contains anundefinedwith object notation this is working:

Context 🔦
I have a dialog with dialog action buttons. For mobile, I want to stack them vertically, otherwise horizontally. (I know screenshot shows otherwise 😉 )
Your environment 🌎
`npx @mui/envinfo`