Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can modify the title of a React page upon loading by updating the document title in the useEffect hook of your main component, like this:

import React, { useEffect } from 'react';

function App() {
  useEffect(() => {
    document.title = "New Title"
  }, [])

  return (
    <div>
      {/* Your App content */}
    </div>
  );
}

export default App;

This code will modify the document title to "New Title" as soon as the component is mounted.