Skip to Main Content
React Projects
book

React Projects

by Roy Derks
December 2019
Intermediate to advanced content levelIntermediate to advanced
474 pages
10h 3m
English
Packt Publishing
Content preview from React Projects

Adding head tags using React Helmet

Assuming you want your application to be indexed by search engines, you need to set head tags for the crawlers to identify the content on your page. This is something you want to do dynamically for each route route, as each route will have different content. A popular package for setting these head tags in React applications is React Helmet, which has support for SSR. You can install React Helmet with npm:

npm install react-helmet

React Helmet can define the head tags in any component that is rendered by your application, and if nested, the lowest definition of a Helmet component in the component tree will be used. That's why you can create a Helmet component in your Header component for all routes ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

React Projects - Second Edition

React Projects - Second Edition

Roy Derks
Test-Driven React

Test-Driven React

Trevor Burnham

Publisher Resources

ISBN: 9781789954937Supplemental Content