Socket
Socket
Sign inDemoInstall

react-router-dom-v5-compat

Package Overview
Dependencies
21
Maintainers
1
Versions
209
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install
Previous1
1618
21Next

6.6.1

Diff

Changelog

Source

v6.6.1

Date: 2022-12-23

Patch Changes

  • Include submission info in shouldRevalidate on action redirects (#9777, #9782)
  • Reset actionData on action redirect to current location (#9772)

Full Changelog: v6.6.0...v6.6.1

mjackson
published 6.6.1-pre.1 •

mjackson
published 6.6.1-pre.0 •

mjackson
published 6.6.0 •

Changelog

Source

v6.6.0

Date: 2022-12-21

What's Changed

This minor release is primarily to stabilize our SSR APIs for Data Routers now that we've wired up the new RouterProvider in Remix as part of the React Router-ing Remix work.

Minor Changes

  • Remove unstable_ prefix from createStaticHandler/createStaticRouter/StaticRouterProvider (#9738)
  • Add useBeforeUnload() hook (#9664)

Patch Changes

  • Support uppercase <Form method> and useSubmit method values (#9664)
  • Fix <button formmethod> form submission overriddes (#9664)
  • Fix explicit replace on submissions and PUSH on submission to new paths (#9734)
  • Prevent useLoaderData usage in errorElement (#9735)
  • Proper hydration of Error objects from StaticRouterProvider (#9664)
  • Skip initial scroll restoration for SSR apps with hydrationData (#9664)
  • Fix a few bugs where loader/action data wasn't properly cleared on errors (#9735)

Full Changelog: v6.5.0...v6.6.0

mjackson
published 6.6.0-pre.0 •

mjackson
published 6.5.0 •

Changelog

Source

v6.5.0

Date: 2022-12-16

What's Changed

This release introduces support for Optional Route Segments. Now, adding a ? to the end of any path segment will make that entire segment optional. This works for both static segments and dynamic parameters.

Optional Params Examples

  • <Route path=":lang?/about> will match:
    • /:lang/about
    • /about
  • <Route path="/multistep/:widget1?/widget2?/widget3?"> will match:
    • /multistep
    • /multistep/:widget1
    • /multistep/:widget1/:widget2
    • /multistep/:widget1/:widget2/:widget3

Optional Static Segment Example

  • <Route path="/home?"> will match:
    • /
    • /home
  • <Route path="/fr?/about"> will match:
    • /about
    • /fr/about

Minor Changes

  • Allows optional routes and optional static segments (#9650)

Patch Changes

  • Stop incorrectly matching on partial named parameters, i.e. <Route path="prefix-:param">, to align with how splat parameters work. If you were previously relying on this behavior then it's recommended to extract the static portion of the path at the useParams call site: (#9506)
// Old behavior at URL /prefix-123
<Route path="prefix-:id" element={<Comp /> }>

function Comp() {
  let params = useParams(); // { id: '123' }
  let id = params.id; // "123"
  ...
}

// New behavior at URL /prefix-123
<Route path=":id" element={<Comp /> }>

function Comp() {
  let params = useParams(); // { id: 'prefix-123' }
  let id = params.id.replace(/^prefix-/, ''); // "123"
  ...
}
  • Persist headers on loader request's after SSR document action request (#9721)
  • Fix requests sent to revalidating loaders so they reflect a GET request (#9660)
  • Fix issue with deeply nested optional segments (#9727)
  • GET forms now expose a submission on the loading navigation (#9695)
  • Fix error boundary tracking for multiple errors bubbling to the same boundary (#9702)

Full Changelog: v6.4.5...v6.5.0

mjackson
published 6.5.0-pre.1 •

mjackson
published 6.5.0-pre.0 •

mjackson
published 6.4.5 •

Changelog

Source

v6.4.5

Date: 2022-12-07

Patch Changes

  • Fix requests sent to revalidating loaders so they reflect a GET request (#9680)
  • Remove instanceof Response checks in favor of isResponse (#9690)
  • Fix URL creation in Cloudflare Pages or other non-browser-environments (#9682, #9689)
  • Add requestContext support to static handler query/queryRoute (#9696)
    • Note that the unstable API of queryRoute(path, routeId) has been changed to queryRoute(path, { routeId, requestContext })

Full Changelog: v6.4.4...v6.4.5

mjackson
published 6.4.5-pre.2 •

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc