-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
handle deep mounted memo components properly
- Loading branch information
1 parent
a4f83d3
commit a149fb0
Showing
5 changed files
with
290 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from 'react'; | ||
|
||
function BasicComponent(props) { | ||
return ( | ||
<div | ||
className={`basic-memo ${props.className}`} | ||
onClick={function handleOnClick() {}} | ||
> | ||
<div id="group-id" className="group"> | ||
<span className="empty" /> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export const BasicMemo = React.memo(BasicComponent); | ||
|
||
function ArrayRender(props) { | ||
return [ | ||
<div className="test" key="test"> | ||
Test | ||
</div>, | ||
<div className="test2" key="test2"> | ||
Test 2 | ||
</div>, | ||
<div className={props.className} key="test3"> | ||
Test 3 | ||
</div>, | ||
]; | ||
} | ||
|
||
export const ArrayMemo = React.memo(ArrayRender); |
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
Oops, something went wrong.