How to use filterDOMProps
?
#7979
Replies: 1 comment 2 replies
-
Thanks for the dicussion.
If you're just curious what it does, it allows through Because it's undocumented and therefore considered private, we do not guarantee its API in semver. If there's a strong reason, we can discuss making it public. |
Beta Was this translation helpful? Give feedback.
-
This is more of a question regarding best practices and patterns. As we build out our internal design system, we have regularely referenced React Spectrum and
react-aria-components
source code. We have seen the usage of a utilityfilterDOMProps
but there really is not much info on this. I am mainly curious what the best practices around this are, and what this utility accomplishes in a Typescript world.My first impression is that it is filtering out props from within the component, so what role does this play if our users are using Typescript exclusively?
It seems to me that this utility is mostly a fallback to ensure that random props do not leak to the DOM in a Non-Typescript environment, would that be a good assumption?
It seems like
filterDOMProps
does not also include props likestyle
andclassName
, so would the idea be that those DOM props always get manually added to our types and de-structured out?Beta Was this translation helpful? Give feedback.
All reactions