Search code examples
clojurescriptreagent

Make meta tag with reagent


I want to render a meta tag with Reagent.

I can not find any info with Google.

[:div (header @company-name)]

Looks like it outputs everything into body. How to write meta tags?


Solution

  • If you want to render something into <head> you should do it as usual with any Reagent UI code.

    (reagent.core/render [header] (.-head js/document))
    

    The above will render into <head>. There's also NPM package that allows rendering into <head> from within your app's UI tree react-helmet.