React

ReactJS Practical Questions - useEffect hook used ...

11.

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

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

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

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

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