T
Size: a a a
T
p
T
ia
p
В
В
А
В
А
p
T
ia
ia
T
const Parent = (tablist, hide, tabcontent) => {
return {
{tablist.map(...)}
<div style={display: hide ? 'none' : 'block'}>{tabcontent}</div>
}
}
T
p
p
import { memo } from "react";
const App = memo(
(tablist, hide, tabcontent) => {
return <div>1</div>;
},
(prevProps, nextProps) => {
if (prevProps === nextProps) {
return true; // no re-render
}
if (prevProps.tabcontent !== nextProps.tabcontent && nextProps.hide) {
return true; // no re-render
}
return false; // re-render
}
);
export { App };
T