Skip to content

Commit

Permalink
Merge pull request alibaba#811 from rain0002009/rain0002009-patch-1
Browse files Browse the repository at this point in the history
fix: useReactive
  • Loading branch information
awmleer authored Jan 4, 2021
2 parents 2ba6403 + ed2ab36 commit 515f687
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/hooks/src/useReactive/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function observer<T extends object>(initialVal: T, cb: () => void) {
const proxy = new Proxy<T>(initialVal, {
get(target, key, receiver) {
const res = Reflect.get(target, key, receiver);
return typeof res === 'object' ? observer(res, cb) : Reflect.get(target, key);
return (typeof res === 'object' && res !== null) ? observer(res, cb) : Reflect.get(target, key);
},
set(target, key, val) {
const ret = Reflect.set(target, key, val);
Expand Down

0 comments on commit 515f687

Please sign in to comment.