React Router 7 recently launched its long-awaited middleware feature, stable since v7.9.0. Middleware is now fully supported on Netlify. How to use it Ensure you're on version 7.9.0 or later of React Router: npm install react-router@latest @react-router/node@latest @react-router/dev@latest Upgrade to version 2 of the Netlify React Router plugin: npm install @netlify/vite-plugin-react-router@latest After that, middleware works out of the box. Next steps
Continue reading...
- Check out the full React Router middleware docs
- Create a new React Router 7 project with our updated template
- Read the Netlify React Router plugin docs for more on loader/action context and to access type-safe Netlify context in middleware
Continue reading...