Skip to content
This repository was archived by the owner on Oct 16, 2024. It is now read-only.

Commit 283a4ac

Browse files
committed
fixed proxy error message
1 parent 855a921 commit 283a4ac

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

packages/react/src/hooks/useAgile.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,19 +84,19 @@ export function useAgile<
8484
if (dep == null) return undefined as any;
8585
const value = dep.value;
8686

87-
if (proxyPackage != null) {
88-
// If proxyBased and the value is of the type object.
89-
// Wrap a Proxy around the object to track the accessed properties.
90-
if (config.proxyBased && isValidObject(value, true)) {
87+
// If proxyBased and the value is of the type object.
88+
// Wrap a Proxy around the object to track the accessed properties.
89+
if (config.proxyBased && isValidObject(value, true)) {
90+
if (proxyPackage != null) {
9191
const proxyTree = new proxyPackage.ProxyTree(value);
9292
proxyTreeWeakMap.set(dep, proxyTree);
9393
return proxyTree.proxy;
94+
} else {
95+
console.error(
96+
'In order to use the Agile proxy functionality, ' +
97+
`the installation of an additional package called '@agile-ts/proxytree' is required!`
98+
);
9499
}
95-
} else {
96-
console.error(
97-
'In order to use the Agile proxy functionality, ' +
98-
`the installation of an additional package called '@agile-ts/proxytree' is required!`
99-
);
100100
}
101101

102102
// If specified selector function and the value is of type object.

0 commit comments

Comments
 (0)