-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes issues due to transition delay in closing alerts. (#2321)
* Created memoized children component that updates the children only when the should update prop is set to true. * Wrapped the modal children in the memoized component and set the shouldUpdate to isOpen or forceRender prop. * Added the new prop to the props list and the types file. * Updated button to be disabled only when the submission was going on. * Removed the test to verify the submit button calls are prevented during closing transition since it was a false test case. * Update types/Modal.d.ts Co-authored-by: Abhay V Ashokan <[email protected]> --------- Co-authored-by: Abhay V Ashokan <[email protected]>
- Loading branch information
1 parent
be30d03
commit 6f88e0c
Showing
5 changed files
with
31 additions
and
29 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from "react"; | ||
|
||
const MemoizedChildren = React.memo( | ||
({ children }) => children, | ||
(_, { shouldUpdate }) => !shouldUpdate | ||
); | ||
|
||
MemoizedChildren.displayName = "MemoizedChildren"; | ||
|
||
export default MemoizedChildren; |
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