@navinc/base-react-components
Version:
Nav's Pattern Library
12 lines • 561 B
JavaScript
import isPropValid from '@emotion/is-prop-valid';
export { isPropValid };
// This implements the default behavior from styled-components v5. See https://styled-components.com/docs/faqs#shouldforwardprop-is-no-longer-provided-by-default
export const shouldForwardProp = (propName, target) => {
if (typeof target === 'string') {
// For HTML elements, forward the prop if it is a valid HTML attribute
return isPropValid(propName);
}
// For other elements, forward all props
return true;
};
//# sourceMappingURL=is-prop-valid.js.map