A declarative React component for data fetching that integrates seamlessly with Redux. Version 1.5.6 (stable, no recent updates) stores fetched data in the Redux store, acting as a cache. Unlike similar libraries, it uses render props and is BYOD (Bring Your Own Datafetcher), making no assumptions about how data is fetched. It reduces boilerplate by eliminating the need for manual action creators, reducers, and thunks/sagas. Requires React ^16.3 and react-redux ^5.
npm install react-redux-requestNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates basic setup: adding the reducer to the store and using the Request component with a fetch promise and a render prop showing status.
Ensure 'fn' returns a promise (e.g., using fetch or axios).
Use distinct strings for different data fetching endpoints.
Use combineReducers({ reactReduxRequest: reducer, ...otherReducers }) or configure store with that key.Memoize the 'args' array or use primitive values to avoid unnecessary re-fetches.
Add the reducer: combineReducers({ reactReduxRequest: reducer })Pass a function that returns a promise to the 'fn' prop.
Provide a 'render' prop that returns a React element.