React

ReactJS Practical Questions - useEffect Hook in Re...

30.

Which Hook could be used to update the document's title?

useEffect(() => { title = name + ' ' + lastname; });

useContext(function updateTitle() { title = name + ' ' + lastname; });

useEffect(function updateTitle() { document.title = name + ' ' + lastname; });

useState(function updateTitle() { name + ' ' + lastname; });