Answers for "set title react app"

2

react set title of page

import React, { useEffect } from 'react'
import ReactDOM from 'react-dom'

const App = () => {
  // This effect runs once, after the first render
  useEffect(() => {
    document.title = "This is a title"
  }, [])
  
  return <h1>Hello, World!</h1>
};

ReactDOM.render(
  <App />,
  document.getElementById('root')
);
Posted by: Guest on July-15-2020
0

how to change the title of create-react-app

You can find the source HTML file in the public folder of the generated project. 
You may edit the <title> tag in it to change the title from “React App” to anything else.
Posted by: Guest on June-19-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language