Hi,
Building an app and i want to try make the site title more adaptable to change. Right now to change the site title I use this code on each page:
useEffect(() => {
document.title = “Dashboard | Company”;
}, []);
Obviously if the company name changes i don’t want to have to go through each and every page changing the document.title value. is there a way to make it more centralised and say if no title assigned just use default one.
Right now my thinking is leaning towards creating a config.js file that has a bunch of constants in it for site-wide usage and then import them on every page that requires them but idk. is there an easier/better way to achieve this? Thanks
submitted by /u/KiwiStunningGrape
[link] [comments]