question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Import react-helmet to SSR

See original GitHub issue

Steps to reproduce

yarn add react-helmet

// in Foo.js
import { Helmet } from 'react-helmet'

function Foo(props) {
  return (
    <>
      <Helmet><title>Foo</title></Helmet>
      Foo
    </>
  )
}

= react_component 'Foo', {}, { prerender: true }

Is there a way to get meta from Helmet.renderStatic() to rails?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
BookOfGregcommented, Jul 5, 2019

Cool, I’ll look into if I can get something working there. https://github.com/nfl/react-helmet Congrats on issue 1000 😃

Do you happen to know any other react plugins that have side effects like this one? Would be good to try get a general solution.

1reaction
bragovocommented, Jul 5, 2019

Yeah, there is not any meta or title in string after react_component. Helmet not add <title> tag in output, only changing existed in <head>. react_on_rails gem has react_component_hash helper for this.

Read more comments on GitHub >

github_iconTop Results From Across the Web

node.js - How setup react-helmet with Server Side Rendering?
When I run the above code, I get an error saying 'cannot use import statement outside a module'. Is it possible to use...
Read more >
How to Use React Helmet – With Example Use Case
In this article, we'll cover the following steps: How to install and import the React Helmet library. Basic usage for client and server...
Read more >
Search-optimized SPAs with React Helmet - LogRocket Blog
To use React Helmet, you first import the Helmet component, then you add the elements you want in your document's <head> . //...
Read more >
React and Server Side Rendering (SSR) | by Gagandeep Singh
import {StaticRouter} from "react-router-dom"; import {Helmet} from "react-helmet"; const app = Express(); const port = 8092;
Read more >
react helmet express ssr - Code Examples & Solutions For ...
React Helmet with SSR integration ; 1. // server/index.js ; 2. import React from "react"; ; 3. import { renderToString } from "react-dom/server";....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found