Skip to content

Commit

Permalink
fix reactivity on provide reactive initial value
Browse files Browse the repository at this point in the history
  • Loading branch information
rudnik275 committed Mar 23, 2024
1 parent 6d8da82 commit 963ee11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/tracked-instance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export function useTrackedInstance<Data>(
}
}))

const _data = createNestedRef<InternalData>({root: initialData} as InternalData, (parentThree) => ({
const _data = createNestedRef<InternalData>({root: cloneDeep(initialData)} as InternalData, (parentThree) => ({
set(target, property: string, value, receiver) {
const path = parentThree.concat({target, property, receiver})
const oldValue = target[property as keyof typeof target]
Expand Down

0 comments on commit 963ee11

Please sign in to comment.