Open adi-doorloop opened 3 months ago
I could certainly memoize it more. It does need to get called any time the ViewProps
for a given view change. So for example, when the active view is changed, it needs to get called for the previous active view (with active: false
) and the next active view (with active: true
). And the transitionState
for both of the views goes through several changes during the transition process as well. I forget if transitionState
can change on first mount, later I can check if react-transition-state
does so to see if that causes any additional renders.
I'll think about an API you can use to opt out of calls to changes to ViewProps
if you aren't using those props. Using react-view-slider/simple
doesn't rerender as much, though I don't know if it's suitable for your use case
I don't understand why it does this, it seems to cause unnecessary re-renders. Explain?