Skip to content

useExperienceMeta

Describes@ebitex/starter-kit-react 1.xSee the changelog:@ebitex/starter-kit-react

useExperienceMeta(meta): void

Lets a section say something about the page it is on, such as a product section setting the title, description, canonical address and structured data from the product it loaded.

useExperienceMeta({ title: product?.name, description: product?.summary, canonical: product && `https://shop.example/products/${product.key}` })

<EbitexExperience> collects every contribution on the page and writes the merged result to the document in one place, in the browser (like the page’s own SEO fields, it is not rendered on a server). Per member, the deepest contribution wins (a section inside a group beats the group, and the page’s own fields are the least specific of all); at equal depth the later one on the page wins. A contribution is withdrawn when its section unmounts, and the page’s own values come back. Outside <EbitexExperience> it does nothing.

Pass a fresh object on every render if you like: the contribution is compared by value.

ExperienceMeta

void