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; });
Correct: C
The useEffect Hook can be used to perform side effects in a React component. By specifying a function inside the useEffect Hook, we can update the document's title using the document.title property. useEffect(function updateTitle() { document.title = name + ' ' + lastname; }); The useEffect Hook will call this function every time the component is rendered or when specific dependencies change.