Reusable component using theme-based Box features
问题 I'd like to create a reusable component using Material-UI's api (not using styled-components.) I got this far - and it almost works - but the settings that use theme variable don't work (e.g, bgcolor and padding). Am I doing something wrong - or is this not possible? const BigPanel = styled(Box)({ display: 'flex', width: '100%', flexgrow: 1, bgcolor: 'background.paper', borderRadius: 10, boxShadow:'1', p:{ xs: 4, md: 8 } }); 回答1: The object passed to styled is intended to be CSS properties,