🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

react-router

Package Overview
Dependencies
Maintainers
4
Versions
835
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-router - npm Package Versions

2345
84

0.0.0-nightly-f8c9a7158-20250604

Diff
mjackson
published 0.0.0-nightly-f8c9a7158-20250604 •
mjackson
published 7.6.2 •

Changelog

Source

v7.6.2

Date: 2025-06-03

Patch Changes

  • create-react-router - Update tar-fs (#13675)

  • react-router - (INTERNAL) Slight refactor of internal headers() function processing for use with RSC (#13639)

  • react-router @react-router/dev - Avoid additional with-props chunk in Framework Mode by moving route module component prop logic from the Vite plugin to react-router (#13650)

  • @react-router/dev - When future.unstable_viteEnvironmentApi is enabled and an absolute Vite base has been configured, ensure critical CSS is handled correctly during development (#13598)

  • @react-router/dev - Update vite-node (#13673)

  • @react-router/dev - Fix typegen for non-{.js,.jsx,.ts,.tsx} routes like .mdx (#12453)

  • @react-router/dev - Fix href types for optional dynamic params (#13725)

    7.6.1 introduced fixes for href when using optional static segments, but those fixes caused regressions with how optional dynamic params worked in 7.6.0:

    // 7.6.0
    href("/users/:id?"); // ✅
    href("/users/:id?", { id: 1 }); // ✅
    
    // 7.6.1
    href("/users/:id?"); // ❌
    href("/users/:id?", { id: 1 }); // ❌
    

    Now, optional static segments are expanded into different paths for href, but optional dynamic params are not. This way href can unambiguously refer to an exact URL path, all while keeping the number of path options to a minimum.

    // 7.6.2
    
    // path: /users/:id?/edit?
    href("
    //    ^ suggestions when cursor is here:
    //
    //    /users/:id?
    //    /users/:id?/edit
    

    Additionally, you can pass params from component props without needing to narrow them manually:

    declare const params: { id?: number };
    
    // 7.6.0
    href("/users/:id?", params);
    
    // 7.6.1
    href("/users/:id?", params); // ❌
    "id" in params ? href("/users/:id", params) : href("/users"); // works... but is annoying
    
    // 7.6.2
    href("/users/:id?", params); // restores behavior of 7.6.0
    

Changes by Package

Full Changelog: v7.6.1...v7.6.2

mjackson
published 0.0.0-nightly-3ab810de1-20250603 •
mjackson
published 0.0.0-experimental-d82b9430b •
mjackson
published 0.0.0-experimental-17b9b60af •
mjackson
published 0.0.0-experimental-1fcc8eb1d •
mjackson
published 0.0.0-experimental-c1f0daeff •
mjackson
published 0.0.0-experimental-e7eb25a7b •
mjackson
published 0.0.0-nightly-a7ab88a70-20250528 •
mjackson
published 0.0.0-experimental-8c9575952 •
2345
84