Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function useProps(props) {
const as = props.as || props.forwardedAs || undefined
return { as, safeProps: omit(props, omittedProps) }
}
const SystemComponent = forwardRef(function SystemComponent(
{ as, ...props },
ref,
) {
const omittedProps = omit(props, system.meta.props)
const Component = as || defaultComponent
return createElement(Component, { ref, ...omittedProps })
})
SystemComponent.displayName = 'SystemComponent'