Giter Site home page Giter Site logo

Comments (5)

felixh10r avatar felixh10r commented on June 12, 2024 9

i can confirm this is an issue with stable react 18 root api. is this project actively maintained? i'd be happy to open a PR if desired.

from react-helmet.

PaulMest avatar PaulMest commented on June 12, 2024 4

Seems like this is a fork that has more traction and is more actively maintained: https://github.com/staylor/react-helmet-async

from react-helmet.

eyerean avatar eyerean commented on June 12, 2024 2

Maybe something like that could be used instead, if you don't want to replace packages:

import * as React from 'react';
import {Helmet as ReactHelmet, HelmetProps as ReactHelmetProps} from 'react-helmet';

interface HelmetProps extends ReactHelmetProps, React.PropsWithChildren {}

const Helmet = (props: HelmetProps) => <ReactHelmet {...props} />;

from react-helmet.

eugeniosegala avatar eugeniosegala commented on June 12, 2024 1

I "solved" this problem by adding a key to the Helmet wrapper.

Something like:

<Helmet key={id}>
...
</Helmet>

Not a real solution but only a temporary workaround.

You can also probably add the key only to the single tag that needs to be refreshed 🤞

from react-helmet.

wongchichong avatar wongchichong commented on June 12, 2024

I had used the root api 18 with [email protected]

import { createRoot } from 'react-dom/client'

const root = createRoot(document.getElementById("root"))
root.render()

found that some of the tags previously added by helmet will be removed by others nested helmet.
but when revert back to old syntax with react 18

render(, document.getElementById("root"))

the problem disappeared.

I can't replicate this problem in simple project in codesandbox, because react router involved.

from react-helmet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.