A simple, declarative, and composable way to fetch data for React components. Current stable version is 3.0.1, last updated in 2020. It provides a higher-order component (connect) and decorators to declaratively specify data dependencies. Key differentiators include automatic request deduplication, caching, and support for refreshing data (e.g., with React Hot Loader). However, the package is effectively unmaintained, with no updates since 2017, and works only with React class components (not hooks). No longer recommended for new projects.
npm install react-refetchNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to use connect to fetch data declaratively and handle loading/error states.
Use modern alternatives like react-query, SWR, or Redux Toolkit Query.
Ensure the first argument to connect is a function returning an object with key: { url: '...' } structure.Refactor to use a class component or switch to a hooks-based library.
Check that the connect map function returns a proper object with keys matching the prop name, e.g., { myProp: { url: '...' } }.Ensure you are calling connect correctly and the map function returns the expected prop names.
Verify the URL is correct and allows cross-origin requests. Use a proxy if necessary.