A given component will re-render if its (or its parents) props or state changes. It can be useful to know when and why this render occurs. Put this componentDidUpdate
in your component to log
the changes that caused the render.
Note that if the values from
and to
are the same in the logs, then it's probably because a new object is being generated with the same value, causing unnecessary re-rendering, this should be fixed.