Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

fix(divider): correct rest-prop spread order for contract props (#4325)

Cindy Zhangfdd7b2378eea
diff --git a/.changeset/divider-rest-prop-order.md b/.changeset/divider-rest-prop-order.md
new file mode 100644
index 0000000000..6b41d474dd
--- /dev/null
+++ b/.changeset/divider-rest-prop-order.md
@@ -0,0 +1,7 @@
+---
+'@astryxdesign/core': patch
+---
+
+[fix] Fix Divider rest-prop spread order so consumer-passed HTML attributes cannot overwrite the component's `role="separator"` or `aria-orientation`.
+
+@cixzhang
diff --git a/packages/core/src/Divider/Divider.tsx b/packages/core/src/Divider/Divider.tsx
index 76eec171f7..57de56980f 100644
--- a/packages/core/src/Divider/Divider.tsx
+++ b/packages/core/src/Divider/Divider.tsx
@@ -172,6 +172,7 @@ export function Divider({
return (
<div
ref={ref}
+ {...props}
role="separator"
aria-orientation={orientation}
{...mergeProps(
@@ -186,8 +187,7 @@ export function Divider({
),
className,
style,
- )}
- {...props}>
+ )}>
<div
{...stylex.props(
isHorizontal ? lineStyles.horizontalLine : lineStyles.verticalLine,