Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
componentDidMount() {
loadCSS(
'https://use.fontawesome.com/releases/v5.1.0/css/all.css',
document.querySelector('#font-awesome-css'),
);
}
React.useEffect(() => {
const styleNode = loadCSS(
'https://cdn.jsdelivr.net/docsearch.js/2/docsearch.min.css',
document.querySelector('#app-search'),
);
return () => {
styleNode.parentElement.removeChild(styleNode);
};
}, []);