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 from 'react'; | |
if (process.env.NODE_ENV !== 'production') { | |
const whyDidYouRender = require('@welldone-software/why-did-you-render'); | |
whyDidYouRender(React, { | |
trackAllPureComponents: true, | |
trackExtraHooks: [[ReactRedux, "useSelector"]] | |
}); | |
} |
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
const BrokenBigPureComponent = React.memo(() => { | |
const data = useSelector(state => ({ text: state.text })); | |
return ( | |
<p>{data.text}</p> | |
); | |
}); |
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
function App() { | |
console.log("App - start render"); | |
React.useEffect(() => console.log("App - rendered")); | |
return React.createElement( | |
Parent, | |
null, | |
React.createElement(Child, null), | |
React.createElement(Child, null), | |
React.createElement(Child, null) |
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
function App() { | |
console.log("App - start render"); | |
React.useEffect(() => console.log("App - rendered")); | |
return ( | |
<Parent> | |
<Child /> | |
<Child /> | |
<Child /> | |
</Parent> | |
); |
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
html.colors { | |
--red: #d47c7c; | |
--purple: #9e42f5; | |
} | |
html.concepts { | |
--main-brand-color: var(--red); | |
--secondary-brand-color: var(--purple); | |
--main-shadow-color: var(--red); | |
} |
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
html.colors { | |
... | |
--red: #d47c7c; | |
--purple: #9e42f5; | |
} | |
html.entities { | |
/* ... 50 more enteties */ | |
--action-button-background-color: var(--red); | |
--action-button-shadow-color: var(--red); |
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
<section id="about-us" class="dark-mode-colors dark-mode-entities"> | |
... | |
</section> |
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
html.dark-mode-colors { | |
... | |
--gray: #666; | |
} | |
html.dark-mode-entities { | |
... | |
--action-button-background-color: var(--gray) | |
} |
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
html.colors { | |
... | |
--red: #d47c7c; | |
} | |
html.enteties { | |
... | |
--action-button-background-color: var(--red); | |
} |
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
html.colors { | |
... | |
--red: #d47c7c; | |
} |