diff --git a/packages/webpack-plugin/lib/runtime/components/react/mpx-view.tsx b/packages/webpack-plugin/lib/runtime/components/react/mpx-view.tsx index a71b8150b..6ce477400 100644 --- a/packages/webpack-plugin/lib/runtime/components/react/mpx-view.tsx +++ b/packages/webpack-plugin/lib/runtime/components/react/mpx-view.tsx @@ -754,7 +754,7 @@ const _View = forwardRef, _ViewProps>((viewProps, r layoutProps } = useLayout({ props, hasSelfPercent, setWidth, setHeight, nodeRef }) - const viewStyle = { ...innerStyle, ...layoutStyle } + const viewStyle = Object.assign({}, innerStyle, layoutStyle) const innerProps = useInnerProps(props, { ref: nodeRef, style: viewStyle, diff --git a/packages/webpack-plugin/lib/runtime/components/react/useAnimationHooks.ts b/packages/webpack-plugin/lib/runtime/components/react/useAnimationHooks.ts index 4fa525bca..f41cb5d0b 100644 --- a/packages/webpack-plugin/lib/runtime/components/react/useAnimationHooks.ts +++ b/packages/webpack-plugin/lib/runtime/components/react/useAnimationHooks.ts @@ -72,8 +72,7 @@ const TransformInitial: ExtendedViewStyle = { // translateZ: 0, } // 动画默认初始值 -const InitialValue: ExtendedViewStyle = { - ...TransformInitial, +const InitialValue: ExtendedViewStyle = Object.assign({ opacity: 1, backgroundColor: 'transparent', width: 0, @@ -83,7 +82,7 @@ const InitialValue: ExtendedViewStyle = { bottom: 0, left: 0, transformOrigin: ['50%', '50%', 0] -} +}, TransformInitial) const TransformOrigin = 'transformOrigin' // deg 角度 // const isDeg = (key: RuleKey) => ['rotateX', 'rotateY', 'rotateZ', 'rotate', 'skewX', 'skewY'].includes(key)