question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Component not reflecting state in store

See original GitHub issue

Are you submitting a bug report or a feature request?

Bug Report

What is the current behavior?

I created a very simple yes / no component mapped to true / false values. When clicking “No” the value is updated in the store, but the component does not update. Only after clicking Yes first the component updates when clicking No.

What is the expected behavior?

The component should reflect the store in the state.

Sandbox Link

https://codesandbox.io/s/r06VKjB4K

What’s your environment?

redux-form 6.8 redux 3.6 react-redux 5.0.4

Other information

I apologize if this is not a bug, but this seems extremely counter intuitive for users trying to build custom components. My hunch feeling says this is a bug because somewhere the state isn’t being strictly compared.

Update:

Adding a formatter or a parser that does nothing ( format={value=>value} ) has a side effect of fixing the problem. This amplifies my feeling that this is in fact a bug.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
erikrascommented, Jun 15, 2017

Here’s the bug.

I’m trying to figure out why this was written like this.

0reactions
lock[bot]commented, Jul 11, 2018

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React component not updating when store state has changed
Below is my component class. The component never seems to execute componentWillUpdate(), even when I can see the state updating by logging ...
Read more >
Why isn't my React component updating (using Redux)?
Your useSelector is subscribing to the value in the store, but its value is not updated at all. Never mutate the state in...
Read more >
Why React doesn't update state immediately - LogRocket Blog
Each React component manages its own state internally. In this article, we'll explore the reasons why React doesn't update state immediately.
Read more >
Why Redux Store Changes Don't Re-render - YouTube
When using Redux, it's common to run into issues where your store isn't updating, or isn't updating in the way you expect it...
Read more >
Actions and reducers: updating state - Human Redux
The simplest possible way to update a view is just store.subscribe() and then in that function, call store.getState() and re-render. // assume that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found