Should renderProps.children be spread as a DOM attribute in ProgressBar? #8505
Answered
by
snowystinger
jbenning-ic
asked this question in
Q&A
-
While reviewing the ProgressBar implementation, I noticed the following line: <div {...progressBarProps} {...renderProps} ref={ref} slot={props.slot || undefined}> Wouldn’t spreading as an attribute?
If so, is this intentional? Or should children be destructured from renderProps and placed inside the div instead? Typically, children isn’t a valid DOM attribute and should be rendered as content within the element. Reference: |
Beta Was this translation helpful? Give feedback.
Answered by
snowystinger
Jul 7, 2025
Replies: 1 comment
-
Spreading children into there is fine, it'd overwritten by the actual JSX children since they come "later" (last) in the props |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
jbenning-ic
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Spreading children into there is fine, it'd overwritten by the actual JSX children since they come "later" (last) in the props