Skip to content

Commit

Permalink
fix(hmr): full diff props for non-sfc component (#2359)
Browse files Browse the repository at this point in the history
  • Loading branch information
underfin authored Oct 15, 2020
1 parent c6443a4 commit e78915a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/runtime-core/src/componentProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,14 @@ export function updateProps(
const [options] = instance.propsOptions

if (
// always force full diff if hmr is enabled
!(__DEV__ && instance.type.__hmrId) &&
// always force full diff in dev
// - #1942 if hmr is enabled with sfc component
// - vite#872 non-sfc component used by sfc component
!(
__DEV__ &&
(instance.type.__hmrId ||
(instance.parent && instance.parent.type.__hmrId))
) &&
(optimized || patchFlag > 0) &&
!(patchFlag & PatchFlags.FULL_PROPS)
) {
Expand Down

0 comments on commit e78915a

Please sign in to comment.