Repository navigation
Added
react-helmet-async/package.jsonresolves again. Theexportsmap added in 3.0.0 had left it out.
Changed
- On React 19, mounted
<Helmet>instances are merged again, as on React 16–18: the innermost<title>wins and uses the nearesttitleTemplateanddefaultTitle, and a tag that several<Helmet>s set, such as<meta name="description">, renders once, from the innermost one. Server rendering still outputs every<Helmet>'s tags, because instances only merge once they mount, and when hydrating React reuses only the first server-rendered<title>, so a second one stays in<head>. - With
prioritizeSeoTags,<meta charset>moves fromhelmet.metato the start ofhelmet.priority, because browsers only honor a charset declared within the first 1024 bytes of the document. A template that printshelmet.metabut nothelmet.priorityno longer outputs it. - The errors
<Helmet>throws for invalid children or a missing<HelmetProvider>are plainErrors, namedErrorinstead ofInvariant Violation.
Removed
- The
invariantandshallowequaldependencies.
Fixed
- On React 16–18, a
<Helmet>with no<HelmetProvider>above it and nohelmetDataprop throws<Helmet> must be rendered inside a <HelmetProvider> or be given a helmetData prop. If it is, check that only one copy of react-helmet-async is bundled.instead ofTypeError: Cannot read properties of undefined (reading 'add'). - On React 16–18, entries in the
meta,link,script,styleandnoscriptprops that use React attribute names such asitemProp,charSetorhttpEquivare no longer dropped. Their React names are written as HTML attribute names, as for JSX children, sohttpEquivbecomeshttp-equivandclassNamebecomesclassin the DOM and intoString(). <link>,<meta>,<noscript>,<script>and<style>tags inside a fragment are no longer dropped when<Helmet>has more than one fragment, or a fragment next to a tag of the same type.- On React 16–18, function props such as
onLoadare attached as event handlers instead of being written as attributes that contain the function's source, andtoString()leaves them out. Handlers receive the nativeEvent, not a React synthetic event. lib/index.jsandlib/index.esm.jsare compiled to ES2018, so webpack 4, which Create React App 3 and 4 use, can parse them. Since 2.0.0 they contained class fields and optional chaining.- On React 16–18 with
deferon (the default), changes made while the tab is in the background are applied within about a second instead of when the tab is shown again. - A
<base>with only atargetattribute is no longer dropped. The HTML spec allowshref,target, or both.
Full changes: ba5d5fb...v3.1.0