This repository has been archived by the owner on Dec 15, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 113
User state lost in packState
/unpackState
#140
Labels
Comments
Hey @devonray, this definitely looks like a regression! I'll ping you with a new alpha that fixes this. |
Upon further inspection I realize I may have misrepresented the root problem. There seem to be two orthogonal problems that led to my confusion and initial inquiry:
I could see a case for the second issue working as designed. The first issue, however, seems like a bug. |
Did you find a solution to this? We're trying to store a scroll position with each item in the history |
Should be fixed in |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
It's clear that
router.result
contains only custom data specified in the routes hash, but it's not clear how to dynamically persist custom data to history.My specific use case revolves around storing scroll state in the history entry in order to support browser back/forward navigation while preserving scroll position for paginated lists. In v13 both
packState
andunpackState
utils support thestate
attribute, but it seems like it's getting stripped on thelocationDidChange
action at https://github.com/FormidableLabs/redux-little-router/blob/v13.0.0-0/src/enhancer.js#L36, perhaps due to the absence ofstate
from theLocation
type definition.Given that
state
seems to be supported throughout much of the code base I presume this was an unintentional omission from the resulting location descriptor, but I wanted to ask for clarification.The text was updated successfully, but these errors were encountered: