@ar.io/wayfinder-react 1.0.18 → 1.0.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/hooks/index.js +3 -3
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/hooks/index.js
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
* See the License for the specific language governing permissions and
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
|
-
import { useContext, useEffect, useMemo, useState } from 'react';
|
|
17
|
+
import { useCallback, useContext, useEffect, useMemo, useState } from 'react';
|
|
18
18
|
import { WayfinderContext, } from '../components/wayfinder-provider.js';
|
|
19
19
|
/**
|
|
20
20
|
* Hook for getting the Wayfinder instance
|
|
@@ -33,7 +33,7 @@ export const useWayfinder = () => {
|
|
|
33
33
|
*/
|
|
34
34
|
export const useWayfinderRequest = () => {
|
|
35
35
|
const { wayfinder } = useWayfinder();
|
|
36
|
-
return wayfinder.request;
|
|
36
|
+
return useCallback((url) => wayfinder.request(url), [wayfinder]);
|
|
37
37
|
};
|
|
38
38
|
/**
|
|
39
39
|
* Hook for resolving a transaction ID to a WayFinder URL using the Wayfinder instance (e.g. txId -> https://<some-gateway>/txId)
|
|
@@ -42,7 +42,7 @@ export const useWayfinderRequest = () => {
|
|
|
42
42
|
*/
|
|
43
43
|
export const useWayfinderUrl = (params) => {
|
|
44
44
|
const { wayfinder } = useWayfinder();
|
|
45
|
-
const memoizedParams = useMemo(() => params, [params]);
|
|
45
|
+
const memoizedParams = useMemo(() => params, [JSON.stringify(params)]);
|
|
46
46
|
const [resolvedUrl, setResolvedUrl] = useState(null);
|
|
47
47
|
const [isLoading, setIsLoading] = useState(false);
|
|
48
48
|
const [error, setError] = useState(null);
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED