How to use the @xstyled/util.omit function in @xstyled/util

To help you get started, we’ve selected a few @xstyled/util examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github smooth-code / smooth-ui / packages / shared / core / util / factories.js View on Github external
function useProps(props) {
  const as = props.as || props.forwardedAs || undefined
  return { as, safeProps: omit(props, omittedProps) }
}
github smooth-code / xstyled / packages / system / src / systemComponent.js View on Github external
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'