Skip to content

[v6] Missing hashType={"noslash"} of HashRouter #953

@letanloc1998

Description

@letanloc1998

Hi,

I see HashRouter on v6 can't use hashType={"noslash"}.

If I use BrowserRouter, a host must fallback from 404 to index and it takes long time (I deployed my code on gitlab page and it takes 1.5s to processor).

However, HashRouter on v6 can't handle link /#*, it only hanle link /#/*. Eg: if I go to /#notExistLink, it doesn't redirect to not found route.

Does any one have solution to fix this issue?

Thanks.


.gitlab-ci.yml

image: alpine:latest

pages:
    stage: deploy
    script:
        - mkdir .public
        - cp -r ./* .public
        - rm -rf public
        - mv .public public

        # Support React Router for Gitlab Page
        - cp public/index.html public/404.html
    artifacts:
        paths:
            - public
    rules:
        - if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH

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