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

prev.location should always exist #350

Closed
wants to merge 1 commit into from
Closed

prev.location should always exist #350

wants to merge 1 commit into from

Conversation

timwis
Copy link
Member

@timwis timwis commented Dec 10, 2016

Same logic as #227

@timwis timwis requested a review from yoshuawuyts December 10, 2016 19:48
@yoshuawuyts
Copy link
Member

In 4.x prev will be null if it doesn't exist in a prior run - it turned out that having prev.location created way more complicated checks; e.g.

// this is the case in v4 now:
if (prev) // do thing with prev.location.search

// instead if prev.location always exists:
if (prev && prev.location && prev.location.search) // do thing with prev.location.search

In v4 I feel we're closer to being honest by allowing prev to null on a first render and then always have a destructured prev.location setup.

Does this make sense?

Copy link
Member

@yoshuawuyts yoshuawuyts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_

@timwis
Copy link
Member Author

timwis commented Dec 11, 2016

Hm, @yoshuawuyts your requested change isn't showing up for me - it just says _

@timwis timwis closed this Dec 12, 2016
@yoshuawuyts yoshuawuyts deleted the prev.location branch March 19, 2017 17:30
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

Successfully merging this pull request may close these issues.

2 participants