requireMeta()function

requireMeta(meta?: PossibleMeta): Meta
ParamType
metaPossibleMeta
A set of new possible meta data to combine into the current meta context.
    .rootPossibleURL
Base URL for the app — accepts a string or URL, resolved with requireURL(). readonly
    .urlPossibleURI
New URL for the page.
- Resolved using requireURL() if set relative to root readonly
    .paramsPossibleURIParams
Set the params in the URL (not merged with existing params).
- Added to url after it is resolved.
- Baseically readonly
    .linksPossibleMetaLinks
Set of input meta <link /> tags in { rel: href } format, before hrefs are resolved. readonly
    .modulesPossibleMetaAssets
Set of input linked assets in (href)[] format, before hrefs are resolved. readonly
    .scriptsPossibleMetaAssets
Set of input linked assets in (href)[] format, before hrefs are resolved. readonly
    .stylesheetsPossibleMetaAssets
Set of input linked assets in (href)[] format, before hrefs are resolved. readonly
Return
Meta
The current Meta, with meta merged in when provided.

Read the current Meta context, optionally merging in additional meta data.

  • Must be called inside a component or hook (reads context via React's use()).

Examples

const { title, url } = requireMeta();