You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is not a bug report, but more of a general question to this module.
I am currently rewriting my app to use React hooks and at this occasion I'm simplifying much of my code.
My calculate functions are very crowded because I keep them outside my component but they need data from my redux store. So i fetch this data inside my component and then pass it to the functions.
To prevent this I tried another approach:
I created a FormSpy component which does nothing but retrieve the data from my store and my form state, then calculates what I need and then updates the form in a useEffect hook, when the calculated stuff changes.
When looking at this I realized, that I could rebuild all my calculate stuff with these "SubscriberComponents". This makes my code much cleaner.
My first thought was that these data fetching and calculating methods might occur unneccesary often, but I can wrap the calculation in useMemo with the used values from the form state in my dependency array.
Am I missing something else? Is there something I can do with this module that I can't do with my SubscriberComponents?
The text was updated successfully, but these errors were encountered:
Hello,
This is not a bug report, but more of a general question to this module.
I am currently rewriting my app to use React hooks and at this occasion I'm simplifying much of my code.
My calculate functions are very crowded because I keep them outside my component but they need data from my redux store. So i fetch this data inside my component and then pass it to the functions.
To prevent this I tried another approach:
I created a FormSpy component which does nothing but retrieve the data from my store and my form state, then calculates what I need and then updates the form in a useEffect hook, when the calculated stuff changes.
When looking at this I realized, that I could rebuild all my calculate stuff with these "SubscriberComponents". This makes my code much cleaner.
My first thought was that these data fetching and calculating methods might occur unneccesary often, but I can wrap the calculation in useMemo with the used values from the form state in my dependency array.
Am I missing something else? Is there something I can do with this module that I can't do with my SubscriberComponents?
The text was updated successfully, but these errors were encountered: