I was working on a single page application in react.js, so what is the best way to update meta tags on page transitions or browser back/forward?
You can use the document query and update their values.
const setTitle = title => {
const el = document.querySelector('title');
el.innerText = `${el.text} | ${title}`;
};
const setDescription = desc => {
const el = document.querySelector("meta[name='description']");
el.setAttribute('content',desc)
}