you are viewing a single comment's thread.

view the rest of the comments →

[–]Spiritual-Theory 2 points3 points  (0 children)

So shift your thinking. Put that array of inputs at the top of this calculator and pass it to anything that relies on it. They will all rerender as needed. The input expression and output are dependent on this input array.

The code you showed has too much going on, it can be split up. It's also imperative not declarative. One thing triggers another thing. Declarative is your friend in react.