source: imaps-frontend/node_modules/react-use/esm/useFavicon.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 408 bytes
RevLine 
[d565449]1import { useEffect } from 'react';
2var useFavicon = function (href) {
3 useEffect(function () {
4 var link = document.querySelector("link[rel*='icon']") || document.createElement('link');
5 link.type = 'image/x-icon';
6 link.rel = 'shortcut icon';
7 link.href = href;
8 document.getElementsByTagName('head')[0].appendChild(link);
9 }, [href]);
10};
11export default useFavicon;
Note: See TracBrowser for help on using the repository browser.