Skip to content

Commit

Permalink
Ok
Browse files Browse the repository at this point in the history
  • Loading branch information
iegik committed Feb 27, 2024
1 parent d44be1b commit 262c894
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions packages/react/src/emotion-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
}
Expand Down Expand Up @@ -133,7 +133,7 @@ let Emotion = /* #__PURE__ */ withEmotionCache<any, any>(
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)
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/jsx-dev-runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/jsx-runtime.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ 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)
}

return ReactJSXRuntime.jsx(Emotion, createEmotionProps(type, props), key)
}

export function jsxs(type: any, props: any, key: any) {
if (!hasOwn(props, 'css')) {
if (!hasOwn.call(props, 'css')) {
return ReactJSXRuntime.jsxs(type, props, key)
}

Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/jsx.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/utils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// @flow
export let isBrowser = typeof document !== 'undefined'

export const hasOwn = {}.hasOwnProperty.call
export const hasOwn = {}.hasOwnProperty

0 comments on commit 262c894

Please sign in to comment.