xreact-add-rtk-query
v5.5.3
Published
Add RTK Query setup to an existing React app (auto-detects TypeScript).
Maintainers
Readme
xreact-add-rtk-query
Add RTK Query setup to an existing React app. Automatically detects TypeScript via tsconfig.json.
Quick Start
npx xreact-add-rtk-query@latestAlternatives
- Install globally, then run:
npm i -g xreact-add-rtk-query
xreact-add-rtk-query- Add as a project script:
npm pkg set scripts.add-rtk-query="xreact-add-rtk-query"
npm run add-rtk-queryWhat it does
- Installs
@reduxjs/toolkitandreact-redux - Creates
src/store,src/apiwith sampleuserandpostsendpoints - Adds typed hooks for TypeScript
- Wraps your
Appwith aStoreProviderand keeps Router if present
Requirements
- Run it from your app root (where
package.jsonlives) - TypeScript is detected via
tsconfig.json; otherwise JavaScript is assumed
After running
npm run dev