Skip to content

Latest commit

 

History

History
30 lines (21 loc) · 621 Bytes

useFetchers.md

File metadata and controls

30 lines (21 loc) · 621 Bytes
title
useFetchers

useFetchers

[MODES: framework, data]

Summary

Reference Documentation ↗

Returns an array of all in-flight fetchers. This is useful for components throughout the app that didn't create the fetchers but want to use their submissions to participate in optimistic UI.

import { useFetchers } from "react-router";

function SomeComponent() {
  const fetchers = useFetchers();
  fetchers[0].formData; // FormData
  fetchers[0].state; // etc.
  // ...
}

Signature

useFetchers(): undefined