Created
November 4, 2024 13:15
-
-
Save romgrk/f52c757f272a45ad3277f03e5a4fa45d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function wrapSx(Component) { | |
const newComponent = (props) => { | |
const { sx, ...rest } = props | |
rest.className = useSx(sx) | |
return Component(rest) | |
} | |
newComponent.displayName = Component.displayName ?? Component.name | |
return newComponent | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment