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?
Firstly if you don't need dynamic data you can just edit public/index.html
.
For dynamic data the React team recommends to either use react-helmet
import React from "react";
import { Helmet } from "react-helmet";
class Application extends React.Component {
render () {
return (
React app
...
);
}
};
Or using placeholders and replacing them server-side: