-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix unnecessary rerendering of side content in desktop workspace (#2331)
* Memoize SideContent & MobileSideContent * Update test snapshots
- Loading branch information
Showing
4 changed files
with
116 additions
and
105 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import * as _ from 'lodash'; | ||
|
||
/** | ||
* Performs a deep comparison between the previous & next props state | ||
* to determine if they are equivalent. For use with the `React.memo` | ||
* higher order component. | ||
* | ||
* @param prevProps The previous state of the props passed into a component. | ||
* @param nextProps The next state of the props passed into a component | ||
*/ | ||
export const propsAreEqual = <T>(prevProps: T, nextProps: T): boolean => | ||
_.isEqual(prevProps, nextProps); |