-
Notifications
You must be signed in to change notification settings - Fork 660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop using UNSAFE_componentWillMount
#548
Comments
Having the same issue. |
Hm, a quick search through the Helmet source suggests this is a problem with one of their dependencies, I don't see any uses of componentWillMount here |
I believe it's coming from I'm curious to see how the Helmet team resolves this 😄 |
We're looking into Context API to remove our dependency on |
In the meantime, while we wait for a fix from the React Helmet team, does anyone know of a good workaround? This does not seem to stop functionality today, but I am sure it will continue to get more deprecated as time goes on. |
Seems like https://open.nytimes.com/the-future-of-meta-tag-management-for-modern-react-development-ec26a7dc9183 |
I’m experiencing the same issue Seems like |
What's the situation with this 5 months after being reported? Are there any plans to rectify this in the near future? Just installed the library after a break of a few months and it's still complaining about |
Here's my workaround. I can't guarantee that it won't break something, but it seems to be working just fine for now: In node_modules/react-side-effect/lib/index.js:93, change,
to,
.patch file:
|
This issue is also running Running react 17.
|
Same problem... |
npm i react-helmet-async --force --save apart from this, everything were fine. |
replacing react-helmet-async from react-helmet solve my issue. |
using react-helmet-async fixed the problem. |
How did you manage it ? ( assuming you don't use it explicitely but as a nested dependency of react? ) |
@partizanos Add import { Helmet } from 'react-helmet-async’
// …
return (
<>
<Helmet>
<title>{appTitle}</title>
</Helmet>
{children}
</>
) |
I tried this but I am getting below error Dispatcher.js:53 Uncaught TypeError: Cannot read property 'add' of undefined
at t.r.init (Dispatcher.js:53)
at t.r.render (Dispatcher.js:67)
at finishClassComponent (react-dom.development.js:17485)
at updateClassComponent (react-dom.development.js:17435)
at beginWork (react-dom.development.js:19073)
at HTMLUnknownElement.callCallback (react-dom.development.js:3945)
at Object.invokeGuardedCallbackDev (react-dom.development.js:3994)
at invokeGuardedCallback (react-dom.development.js:4056)
at beginWork$1 (react-dom.development.js:23964)
at performUnitOfWork (react-dom.development.js:22776)
at workLoopSync (react-dom.development.js:22707)
at renderRootSync (react-dom.development.js:22670)
at performSyncWorkOnRoot (react-dom.development.js:22293)
at react-dom.development.js:11327
at unstable_runWithPriority (scheduler.development.js:468)
at runWithPriority$1 (react-dom.development.js:11276)
at flushSyncCallbackQueueImpl (react-dom.development.js:11322)
at flushSyncCallbackQueue (react-dom.development.js:11309)
at flushPassiveEffectsImpl (react-dom.development.js:23620)
at unstable_runWithPriority (scheduler.development.js:468)
at runWithPriority$1 (react-dom.development.js:11276)
at flushPassiveEffects (react-dom.development.js:23447)
at react-dom.development.js:23324
at workLoop (scheduler.development.js:417)
at flushWork (scheduler.development.js:390)
at MessagePort.performWorkUntilDeadline (scheduler.development.js:157) |
Are you using |
Getting exact same thing. Using EDIT: was missing a |
Any update on this? |
You must wrap your App with HelmetProvider |
Have done all the above but didn't work. I've install react-helmet-async, wrap the app component with the HelmetProvider etc. But the warn still showing up.
|
Really? it works well for me. import { HelmetProvider, Helmet } from 'react-helmet-async';
function App() {
return (
<div className="App">
<HelmetProvider><Helmet><title>My Title</title></Helmet></HelmetProvider>
</div>
);
} |
…www.npmjs.com/package/react-helmet-async), due to [this issue](nfl/react-helmet#548). The async library requires a <HelmetProvider> encapsulation element, so I added that where I was already using the <Helmet> element.
You need to make use of |
I ended up uninstalling Helmet because of this issue. |
You can use |
Sad that it's still not fixed after over 3,5 years. |
react-helmet-async works though |
But it is a different package ... and not even a single comment or closing this issue with official resolution that this is the only solution. |
I had the same issue with |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
get this warning in console when using Helmet:
If the current behavior is a bug,
please provide the steps to reproduce and if
possible a minimal demo of the problem.
Your bug will get fixed much faster if we can run your
code and it doesn't have dependencies other than React and react-helmet.
Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or
CodeSandbox (https://codesandbox.io/s/new) example below:
just include a
<Helmet>
anywhere in a rendered component in your app.App.tsx
:npm start
What is the expected behavior?
Don't use depreciated react APIs in libraries. Should not get this warning.
Which versions of React and react-helmet, and which browser / OS are affected by this issue?
Did this work in previous versions of React and/or react-helmet?
react-helmet
6.0.0react
16.13.1browser/OS are not relevant, but I'm on macOS 10.15.4, using Chrome 81.0.4044.129 (Official Build) (64-bit)
The text was updated successfully, but these errors were encountered: