I am migrating my app from SPA React to Next.js
I have found this weird bug wherein the SPA I have max-width: 100% while in Next.js width: fit-content
I cannot understand where the different behavior is coming from, I know I can fix it easily but I would like to understand the causes.
code is
const RadioButtonWrapper = styled.div`
color: ${({ theme, dark }) => theme.global.colors[dark ? 'white' : 'black']};
svg {
transform: scale(1.5);
fill: ${({ theme, dark }) => theme.global.colors[dark ? 'white' : 'black']};
}
[class^="StyledRadioButton__StyledRadioButtonContainer"] {
margin-bottom: 6px;
}
[class^="StyledBox__StyledBoxGap"] {
height: 0;
}
[class^="StyledRadioButton__StyledRadioButtonBox"] {
height: 18px;
width: 18px;
transition: opacity 200ms ease-in-out;
border-width: 1px;
border-color: ${({ theme, dark }) => theme.global.colors[dark ? 'white' : 'black']};
margin-bottom: 1px;
}
&:hover {
[class^="StyledRadioButton__StyledRadioButtonBox"] {
border-color: ${({ theme, dark }) => theme.global.colors[dark ? 'white' : 'black']} !important;
}
}
label {
[class^="StyledRadioButton"] {
flex-shrink: 0;
}
}
${({ rightAlign }) => rightAlign
&& ` label {
display: flex;
flex-direction: row-reverse;
justify-content: space-between;
}`}
`;
const RadioButtonGroup = ({ dark, rightAlign, ...props }) => (
<RadioButtonWrapper dark={dark} rightAlign={rightAlign}>
<GrommetRadioButtonGroup {...props} />
</RadioButtonWrapper>
);
SPA
Next.js



