React & React Native

Document metadata (<title> in components)

Në shqip: Metadata e faqes në React

ShpjegimiSQ

Që nga React 19, mund të shkruash <title>, <meta> dhe <link> direkt brenda çdo komponenti, dhe React-i i zhvendos vetë te <head>. Më parë duhej react-helmet.

EnglishEN

Since React 19, you can write <title>, <meta> and <link> right inside any component, and React moves them to <head> itself. Previously you needed react-helmet.

Si ta mendosh

Si t'i ndërrosh etiketën kutisë nga brenda, pa e hapur.

Lexoje në anglisht

Like changing a box's label from the inside, without opening it.

Shembull kodijsx

function FaqjaTermit({ termi }) {
  return <>
    <title>{termi.en} — Fjalori</title>
    <h1>{termi.en}</h1>
  </>; }

Terma të lidhur