Skip to content

Commit a59353c

Browse files
committed
Alphebetize FetcherWithComponents
1 parent 5dc3c2e commit a59353c

File tree

1 file changed

+38
-38
lines changed
  • packages/react-router/lib/dom

1 file changed

+38
-38
lines changed

packages/react-router/lib/dom/lib.tsx

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2632,6 +2632,44 @@ export type FetcherWithComponents<TData> = Fetcher<TData> & {
26322632
FetcherFormProps & React.RefAttributes<HTMLFormElement>
26332633
>;
26342634

2635+
/**
2636+
* Loads data from a route. Useful for loading data imperatively inside user
2637+
* events outside a normal button or form, like a combobox or search input.
2638+
*
2639+
* ```tsx
2640+
* let fetcher = useFetcher()
2641+
*
2642+
* <input onChange={e => {
2643+
* fetcher.load(`/search?q=${e.target.value}`)
2644+
* }} />
2645+
* ```
2646+
*/
2647+
load: (
2648+
href: string,
2649+
opts?: {
2650+
/**
2651+
* Wraps the initial state update for this `fetcher.load` in a
2652+
* [`ReactDOM.flushSync`](https://react.dev/reference/react-dom/flushSync)
2653+
* call instead of the default [`React.startTransition`](https://react.dev/reference/react/startTransition).
2654+
* This allows you to perform synchronous DOM actions immediately after the
2655+
* update is flushed to the DOM.
2656+
*/
2657+
flushSync?: boolean;
2658+
},
2659+
) => Promise<void>;
2660+
2661+
/**
2662+
* Reset a fetcher back to an empty/idle state.
2663+
*
2664+
* If the fetcher is currently in-flight, the
2665+
* [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController)
2666+
* will be aborted with the `reason`, if provided.
2667+
*
2668+
* @param reason Optional `reason` to provide to [`AbortController.abort()`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController/abort)
2669+
* @returns void
2670+
*/
2671+
unstable_reset: (reason?: unknown) => void;
2672+
26352673
/**
26362674
* Submits form data to a route. While multiple nested routes can match a URL, only the leaf route will be called.
26372675
*
@@ -2685,44 +2723,6 @@ export type FetcherWithComponents<TData> = Fetcher<TData> & {
26852723
* ```
26862724
*/
26872725
submit: FetcherSubmitFunction;
2688-
2689-
/**
2690-
* Loads data from a route. Useful for loading data imperatively inside user
2691-
* events outside a normal button or form, like a combobox or search input.
2692-
*
2693-
* ```tsx
2694-
* let fetcher = useFetcher()
2695-
*
2696-
* <input onChange={e => {
2697-
* fetcher.load(`/search?q=${e.target.value}`)
2698-
* }} />
2699-
* ```
2700-
*/
2701-
load: (
2702-
href: string,
2703-
opts?: {
2704-
/**
2705-
* Wraps the initial state update for this `fetcher.load` in a
2706-
* [`ReactDOM.flushSync`](https://react.dev/reference/react-dom/flushSync)
2707-
* call instead of the default [`React.startTransition`](https://react.dev/reference/react/startTransition).
2708-
* This allows you to perform synchronous DOM actions immediately after the
2709-
* update is flushed to the DOM.
2710-
*/
2711-
flushSync?: boolean;
2712-
},
2713-
) => Promise<void>;
2714-
2715-
/**
2716-
* Reset a fetcher back to an empty/idle state.
2717-
*
2718-
* If the fetcher is currently in-flight, the
2719-
* [`AbortController`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController)
2720-
* will be aborted with the `reason`, if provided.
2721-
*
2722-
* @param reason Optional `reason` to provide to [`AbortController.abort()`](https://developer.mozilla.org/en-US/docs/Web/API/AbortController/abort)
2723-
* @returns void
2724-
*/
2725-
unstable_reset: (reason?: unknown) => void;
27262726
};
27272727

27282728
// TODO: (v7) Change the useFetcher generic default from `any` to `unknown`

0 commit comments

Comments
 (0)