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
import React, { useState } from "react"; | |
const Number = ({ number }) => { | |
console.log("number render"); | |
return ( | |
<div> | |
<p>Number:{number}</p> | |
</div> | |
); | |
}; |
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
import React, { useState, useMemo } from "react"; | |
const Number = React.memo(({ number }) => { | |
console.log("number render"); | |
return ( | |
<div> | |
<p>Number:{number}</p> | |
</div> | |
); | |
}); |
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
import React, { useState, useMemo } from "react"; | |
function Number({ number, onClick }) { | |
console.log("number render"); | |
return ( | |
<div> | |
<p>Number:{number}</p> | |
<button onClick={onClick}>Numbering</button> | |
</div> | |
); |
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
import React, { useState, useCallback, useMemo } from "react"; | |
function Number({ number, onClick }) { | |
console.log("number render"); | |
return ( | |
<div> | |
<p>Number:{number}</p> | |
<button onClick={onClick}>Numbering</button> | |
</div> | |
); |