setting a document title tag to an string array element in react with typescript code example
Example: 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')
);