React Router officially supports Active and MaintenanceNode LTS veleases (1) at any given point in time. Dropping support for End of Life Node versions may be done in a React Router Minor release.
fetch
At the time React Router v7 was released, all versions had a usable fetch
implementation so there is generally no need to polyfill any fetch
APIs so long as you're on Node 22 or one of the later Node 20 releases.
fetch
implementationfetch
implementationIf you do find that you need to polyfill anything, you can do so directly from the undici package which node uses internally.
import {
fetch as nodeFetch,
File as NodeFile,
FormData as NodeFormData,
Headers as NodeHeaders,
Request as NodeRequest,
Response as NodeResponse,
} from "undici";
export function polyfillFetch() {
global.File = NodeFile;
global.Headers = NodeHeaders;
global.Request = NodeRequest;
global.Response = NodeResponse;
global.fetch = nodeFetch;
global.FormData = NodeFormData;
}
Based on timing, React Router may drop support for a Node Maintenance LTS version shortly before it goes end-of-life if it better aligns with a React Router Major SemVer release. ↩