Git Product home page Git Product logo

Comments (5)

alanrubin avatar alanrubin commented on August 15, 2024 9

Hi @K4stor I have looked into your code, it seems you are mutating your state in your reducer, you are pushing a new entry into operations array instead of creating a new array. See http://rackt.github.io/redux/docs/basics/Reducers.html or http://rackt.github.io/redux/docs/Troubleshooting.html in the first section. Your state needs to be immutable so that re-render is triggered. Hope it helps !

from react-redux.

K4stor avatar K4stor commented on August 15, 2024

Ah ok that makes sense. Thank you very much ! I will try it tomorrow and let you know if it worked

from react-redux.

gaearon avatar gaearon commented on August 15, 2024

https://github.com/rackt/react-redux#my-views-arent-updating

from react-redux.

bdavisx avatar bdavisx commented on August 15, 2024

Just wanted to update the link that Dan posted above, the troubleshooting section has moved and this shows up pretty high in searches:

https://github.com/reactjs/react-redux/blob/master/docs/troubleshooting.md#my-views-arent-updating

from react-redux.

markerikson avatar markerikson commented on August 15, 2024

Yeah, mutating state is the reason for components not updating like 98% of the time. I've written up an answer on this in my FAQ. It's not merged in yet, so I'll link to the WIP branch: https://github.com/markerikson/redux/blob/merge-faq-page/docs/FAQ.md#why-isnt-my-component-re-rendering-or-my-mapstatetoprops-running

from react-redux.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.