How to use the @emotion/is-prop-valid.default function in @emotion/is-prop-valid

To help you get started, we’ve selected a few @emotion/is-prop-valid 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 callstack / linaria / src / react / styled.js View on Github external
const render = (props, ref) => {
      const { as: component = tag, class: className, ...rest } = props;

      let filteredProps;

      // Check if it's an HTML tag and not a custom element
      if (typeof component === 'string' && component.indexOf('-') === -1) {
        filteredProps = {};

        // eslint-disable-next-line guard-for-in
        for (const key in rest) {
          if (key === 'as' || validAttr(key)) {
            // Don't pass through invalid attributes to HTML elements
            filteredProps[key] = rest[key];
          }
        }
      } else {
        filteredProps = rest;
      }

      filteredProps.ref = ref;
      filteredProps.className = cx(
        filteredProps.className || className,
        options.class
      );

      const { vars } = options;
github framer / motion / src / motion / functionality / dom.tsx View on Github external
isPropValid = (key: string) => {
        // Handle events explicitly as Emotion validates them all as true
        if (key.startsWith("on")) {
            return !isValidMotionProp(key)
        } else {
            return emotionIsPropValid(key)
        }
    }
} catch {
github styled-system / styled-system / packages / should-forward-prop / index.js View on Github external
module.exports = memoize(prop => isPropValid(prop) && !regex.test(prop))

@emotion/is-prop-valid

A function to check whether a prop is valid for HTML and SVG elements

MIT
Latest version published 2 months ago

Package Health Score

84 / 100
Full package analysis

Popular @emotion/is-prop-valid functions

Similar packages