Skip to content

Commit

Permalink
snapshot bug
Browse files Browse the repository at this point in the history
  • Loading branch information
overthemike committed Sep 1, 2024
1 parent 6705332 commit 319ea8d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ type SchemaReturn<T extends ZodType<any>> = {
proxy: (initialState: any, config?: SchemaConfig) => ValtioProxy<z.infer<T>>
}

function updateObjectAtPath(object: any, newValue: any, path: PropType[]) {
function updateObjectAtPath(obj: any, newValue: any, path: PropType[]) {
let stack = [...path]
let object = obj

while (stack.length > 1) {
const key = stack.shift()
Expand Down

0 comments on commit 319ea8d

Please sign in to comment.