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

Fix returning old select value when changes mapStoresToProps #314

Merged
merged 2 commits into from
Oct 28, 2020

Conversation

hanakla
Copy link
Owner

@hanakla hanakla commented Oct 28, 2020

In situation likes "select entity by query id in page" with lambda selector

// Let userId is "1" in first rendering, "2" in next rendering
const { userId } = useParams()

// Expect to return user(id: 1) in first rendering, it works correctly
// 💥WTF💥 Expect to return user(id: 2) in next rendering, but returns user(id: 1)
const user = useStore(getStore => UserSelector.byId(getStore, userId))

In situation likes "select entity by query id in page" with lambda selector
@hanakla
Copy link
Owner Author

hanakla commented Oct 28, 2020

CI遅すぎだから、手元でテストした

@fleur/reactは大丈夫っぽい

@hanakla hanakla merged commit 49f1113 into master Oct 28, 2020
@hanakla hanakla deleted the fix-unexpected-selector-change-ignoring branch October 28, 2020 08:48
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.

1 participant