Skip to content

Restore the parameter passing functionality of params before version 4.1.4 #2438

@nadirvishun

Description

@nadirvishun

What problem is this solving

change log:
This change will break your app. This behavior has worked in some scenarios but has been advised against for years as it's an anti-pattern in routing for many reasons, one of them being reloading the page lose the params. Fortunately, there are multiple alternatives to this anti-pattern

However, reloading the page lose the params is exactly the logical requirement of many business needs, and such business requirements are very common.

动画

If I switch to passing parameters via state, the parameter will still exist upon each refresh. I would need to add a mechanism to delete the parameter to achieve a similar effect:

    const newState = {...history.state};
    delete newState.orderId;
    history.replaceState(newState, "", window.location.href);

Did you conduct a detailed investigation before making the change? or is it simply for the sake of standardization? Why not add a parameter like strict parameter to maintain compatibility with existing features instead of insisting on a break change?

Proposed solution

Restore the parameter passing functionality of params before version 4.1.4. If aiming for standardization, the default can be that parameter passing is ineffective, but compatibility with the original parameter passing function can be achieved through configuration.

Describe alternatives you've considered

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions