Skip to content

Commit 09c33f1

Browse files
authored
fix(flex): Prevent internal <Flex> props from being printed to html (#95185)
Before we would see stuff like `<div wrap="wrap">` and we don't want any props like that exposed. <img width="439" alt="SCR-20250709-oejn" src="https://github.com/user-attachments/assets/afb1b166-c5a8-4efb-9884-182cf82ea302" />
1 parent e473371 commit 09c33f1

File tree

1 file changed

+4
-1
lines changed
  • static/app/components/core/layout

1 file changed

+4
-1
lines changed

static/app/components/core/layout/flex.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ interface FlexProps {
1414
wrap?: CSSProperties['flexWrap'];
1515
}
1616

17-
export const Flex = styled('div')<FlexProps>`
17+
export const Flex = styled('div', {
18+
shouldForwardProp: prop =>
19+
!['align', 'direction', 'flex', 'gap', 'inline', 'justify', 'wrap'].includes(prop),
20+
})<FlexProps>`
1821
display: ${p => (p.inline ? 'inline-flex' : 'flex')};
1922
flex-direction: ${p => p.direction};
2023
justify-content: ${p => p.justify};

0 commit comments

Comments
 (0)