diff --git a/packages/react/src/emotion-element.js b/packages/react/src/emotion-element.js index b1ca38adb3..0ae4c4b64c 100644 --- a/packages/react/src/emotion-element.js +++ b/packages/react/src/emotion-element.js @@ -31,7 +31,7 @@ export const createEmotionProps = (type: React.ElementType, props: Object) => { let newProps: any = {} for (let key in props) { - if (hasOwn(props, key)) { + if (hasOwn.call(props, key)) { newProps[key] = props[key] } } @@ -133,7 +133,7 @@ let Emotion = /* #__PURE__ */ withEmotionCache( const newProps = {} for (let key in props) { if ( - hasOwn(props, key) && + hasOwn.call(props, key) && key !== 'css' && key !== typePropName && (process.env.NODE_ENV === 'production' || key !== labelPropName) diff --git a/packages/react/src/jsx-dev-runtime.js b/packages/react/src/jsx-dev-runtime.js index 1b4ea26184..9b402438a4 100644 --- a/packages/react/src/jsx-dev-runtime.js +++ b/packages/react/src/jsx-dev-runtime.js @@ -13,7 +13,7 @@ export function jsxDEV( source: any, self: any ) { - if (!hasOwn(props, 'css')) { + if (!hasOwn.call(props, 'css')) { return ReactJSXRuntimeDev.jsxDEV( type, props, diff --git a/packages/react/src/jsx-runtime.js b/packages/react/src/jsx-runtime.js index 8fb238b642..d212d4b0f3 100644 --- a/packages/react/src/jsx-runtime.js +++ b/packages/react/src/jsx-runtime.js @@ -6,7 +6,7 @@ import { hasOwn } from './utils' export const Fragment = ReactJSXRuntime.Fragment export function jsx(type: any, props: any, key: any) { - if (!hasOwn(props, 'css')) { + if (!hasOwn.call(props, 'css')) { return ReactJSXRuntime.jsx(type, props, key) } @@ -14,7 +14,7 @@ export function jsx(type: any, props: any, key: any) { } export function jsxs(type: any, props: any, key: any) { - if (!hasOwn(props, 'css')) { + if (!hasOwn.call(props, 'css')) { return ReactJSXRuntime.jsxs(type, props, key) } diff --git a/packages/react/src/jsx.js b/packages/react/src/jsx.js index 70d4ac0d76..7e27f84c4e 100644 --- a/packages/react/src/jsx.js +++ b/packages/react/src/jsx.js @@ -10,7 +10,7 @@ export const jsx: typeof React.createElement = function ( ) { let args = arguments - if (props == null || !hasOwn(props, 'css')) { + if (props == null || !hasOwn.call(props, 'css')) { // $FlowFixMe return React.createElement.apply(undefined, args) } diff --git a/packages/react/src/utils.js b/packages/react/src/utils.js index eba33ab349..305c0a1f66 100644 --- a/packages/react/src/utils.js +++ b/packages/react/src/utils.js @@ -1,4 +1,4 @@ // @flow export let isBrowser = typeof document !== 'undefined' -export const hasOwn = {}.hasOwnProperty.call +export const hasOwn = {}.hasOwnProperty