React · Senior · Question 27 of 75
How do you set <title> and <meta> from a component in React 19 without third-party libraries?
- ✓Correct answer: Render
<title>and<meta>in the component - React hoists them into<head> - 2Only via
document.titlein auseEffectafter mounting - 3Via a
headprop on the root component passed tocreateRoot
Explanation
React 19 supports document metadata: <title>, <meta> and <link> anywhere in the tree are moved into <head>, including during SSR and streaming. It also added style precedence (precedence) and async script support. In Next.js, the Metadata API is usually used instead.