@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.
@@ -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
@@ -14,4 +14,4 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- export declare const WAYFINDER_REACT_VERSION = "v1.0.18";
17
+ export declare const WAYFINDER_REACT_VERSION = "v1.0.19";
package/dist/version.js CHANGED
@@ -14,4 +14,4 @@
14
14
  * See the License for the specific language governing permissions and
15
15
  * limitations under the License.
16
16
  */
17
- export const WAYFINDER_REACT_VERSION = 'v1.0.18';
17
+ export const WAYFINDER_REACT_VERSION = 'v1.0.19';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ar.io/wayfinder-react",
3
- "version": "1.0.18",
3
+ "version": "1.0.19",
4
4
  "description": "React components for WayFinder",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",