One of the major reasons for implementing static rendering is SEO — so given that you’ve set up static rendering, you’re also going to want to know how to render
<title>, and other
Actually, Navi gives you two ways to do this.
Many React apps use the react-helmet package to manage their
<head> tags. If you’re statically rendering your app with
navi-scripts, then react-helmet is supported out of the box! You can import and use the
<Helmet> component like in any other app, and the helmet’s
<meta> tags will be statically rendered along with the rest of your content.
route() functions accepts
route() uses Navi’s
withTitle() functions — you can use these manually to accomplish the same thing, to apply
<meta> tags to multiple routes, or to set a fallback title.
When you declare a
withTitle(), their values will be added to your Route object. This can be useful if you want to set their values from data read from the filesystem, a database, or an API.
As long as you’re using Navi’s
<View /> component, your route’s
title properties will be rendered using react-helmet — just as if you’d specified them yourself using the
<Helmet> component. This means that you can mix
<Helmet> elements and