@firtoz/router-toolkit 5.5.1 → 5.5.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firtoz/router-toolkit",
3
- "version": "5.5.1",
3
+ "version": "5.5.2",
4
4
  "description": "Type-safe React Router 7 framework mode helpers with enhanced fetching, form submission, and state management",
5
5
  "main": "./src/index.ts",
6
6
  "module": "./src/index.ts",
@@ -311,21 +311,27 @@ export const useDynamicSubmitter = <TInfo extends RouteModule>(
311
311
  (target, options) => {
312
312
  return fetcher.submit(target, {
313
313
  ...options,
314
+ method: (options?.method ??
315
+ "POST") as import("react-router").HTMLFormMethod,
314
316
  action: url,
315
317
  encType: "multipart/form-data",
316
- });
318
+ } as Parameters<typeof fetcher.submit>[1]);
317
319
  },
318
320
  [fetcher.submit, url],
319
321
  );
320
322
 
321
323
  const submitJson: SubmitJsonFunc<TInfo> = useCallback(
322
324
  (data, options = {}) => {
323
- return fetcher.submit(data as SubmitTarget, {
324
- ...options,
325
- method: options.method ?? "POST",
326
- action: url,
327
- encType: "application/json",
328
- });
325
+ return fetcher.submit(
326
+ data as SubmitTarget,
327
+ {
328
+ ...options,
329
+ method: (options.method ??
330
+ "POST") as import("react-router").HTMLFormMethod,
331
+ action: url,
332
+ encType: "application/json",
333
+ } as Parameters<typeof fetcher.submit>[1],
334
+ );
329
335
  },
330
336
  [fetcher.submit, url],
331
337
  );