website: make React not re-render Carbon

pull/265/head
Yangshun 3 years ago
parent cde62043ea
commit ab9be4e5cd

@ -12,6 +12,19 @@ import styles from './styles.module.css';
import {ThemeClassNames, useWindowSize} from '@docusaurus/theme-common';
import SidebarAd from '../../components/SidebarAd';
const CarbonAd = React.memo(() => {
return (
<div>
<script
async
type="text/javascript"
src="//cdn.carbonads.com/carbon.js?serve=CEAI4537&placement=wwwtechinterviewhandbookorg"
id="_carbonads_js"
/>
</div>
);
});
export default function DocItem(props) {
const {content: DocContent} = props;
const {metadata, frontMatter} = DocContent;
@ -80,12 +93,7 @@ export default function DocItem(props) {
)}
<DocItemFooter {...props} />
<div className="margin-top--md">
<script
async
type="text/javascript"
src="//cdn.carbonads.com/carbon.js?serve=CEAI4537&placement=wwwtechinterviewhandbookorg"
id="_carbonads_js"
/>
<CarbonAd />
</div>
<div className="margin-top--md">
<DocContent />

Loading…
Cancel
Save