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
in withSnackbar.js, there should be some sort of shallow props checking so that it ensures that it is not unnecessarily re-rendering it's child component. I suppose the shallow prop check would just check whether it already has access to the notistack props?
Current Behavior
Because of the lamda functions below, the child component is getting re-rendered with every single update because of the functions are getting reinstantiated, regardless of the child component already having access to the notistack props.
It turns out this the bug that I found in my project wasn't actually caused by this, but I'm going to leave it open because having lamdas in render functions is inherently bad for performance and the above description still stands true.
The text was updated successfully, but these errors were encountered:
The reason for consumers re-rendering wasn't usage of lambda functions. React used to update consumers when value of SnackbarContext.Provider had changed, and this used to happen on every render because a new object for value prop was getting created.
Keeping reference to value object identical solved the issue.
Expected Behavior
in
withSnackbar.js
, there should be some sort of shallow props checking so that it ensures that it is not unnecessarily re-rendering it's child component. I suppose the shallow prop check would just check whether it already has access to the notistack props?Current Behavior
Because of the lamda functions below, the child component is getting re-rendered with every single update because of the functions are getting reinstantiated, regardless of the child component already having access to the notistack props.
Steps to Reproduce
Link:
It turns out this the bug that I found in my project wasn't actually caused by this, but I'm going to leave it open because having lamdas in render functions is inherently bad for performance and the above description still stands true.
The text was updated successfully, but these errors were encountered: