Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue in route if hash: null #53

Closed
sergeushenecz opened this issue Nov 16, 2021 · 6 comments
Closed

Issue in route if hash: null #53

sergeushenecz opened this issue Nov 16, 2021 · 6 comments

Comments

@sergeushenecz
Copy link

sergeushenecz commented Nov 16, 2021

Hello. Good library a lot of thanks.

I have one question i used library https://github.com/mjrussell/redux-auth-wrapper#readme

i have some code.

import { connectedReduxRedirect } from 'redux-auth-wrapper/history3/redirect';
import { push } from 'redux-first-history';

export const UserIsAuthenticated = connectedReduxRedirect({
  redirectPath: 'login',
  authenticatedSelector: (state) => !isEmpty(state.global.get('currentUser').toJS()),
  redirectAction: push,
  wrapperDisplayName: 'UserIsAuthenticated',
  allowRedirectBack: false,
});

but redirect to login route incorrect. I gettting loginnull instead login
I debugging code and i noticed.
image
if hash: null then i have incorrect route.
I checked if hash: undefined then all good.
Could you help me. Maybe i something understand.

@sergeushenecz sergeushenecz changed the title issue in route if hash: null Issue in route if hash: null Nov 16, 2021
@salvoravida
Copy link
Owner

@sergeu90 please can you provide a codesandbox?

history version? react-router version?

@sergeushenecz
Copy link
Author

sergeushenecz commented Nov 16, 2021

"history": "5.1.0",
"react-router-dom": "6.0.2",

Sorry but sandbox i can't provide now.

You can pass hash: null and check behaviour

@salvoravida
Copy link
Owner

salvoravida commented Nov 16, 2021

the problem is with the history package:
https://github.com/remix-run/history/blob/main/packages/history/index.ts#L1052

null is not a valid value on history v5

it was fine with history v4
https://github.com/remix-run/history/blob/v4/modules/PathUtils.js#L56

@salvoravida
Copy link
Owner

@sergeu90 please open the issue on history repo

@sergeushenecz
Copy link
Author

Thanks.Good research

@salvoravida
Copy link
Owner

@sergeu90 I opened an issue for that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants