'url' property is deprecated - question
See original GitHub issueI am using withRouter
HoC as described in this snippet, however, I am still getting the error:
utils.js:26 Warning: the 'url' property is deprecated. https://err.sh/next.js/url-deprecated
- [x ] I have searched the issues of this repository and believe that this is not a duplicate.
Expected Behavior
Code executes without the deprecation warning.
Current Behavior
The error mentioned above appears.
Steps to Reproduce (for bugs)
- Import
withRouter
to your component - Refer any field from
this.props.router
- Export your component wrapped in
withRouter
HoC - When component is rendered, the deprecation error appears in console
Context
I am implementing Navigation component that is aware of the current route (to highlight the NavItem).
Your Environment
Tech | Version |
---|---|
next | 6.0.0 |
node | 9.11.1 |
OS | OSX 10.13.4 |
browser | Chrome Version 66.0.3359.139 |
Issue Analytics
- State:
- Created 5 years ago
- Reactions:12
- Comments:13 (7 by maintainers)
Top Results From Across the Web
node.js - Hey can you help me out . my 'url.parse' is deprecated
The signature '(urlStr: string): UrlWithStringQuery' of 'url. parse' is deprecated url . The declaration was marked as deprecated here. Can you ...
Read more >url-deprecated | Next.js
Url is deprecated Having a magical url property coming out of nowhere doesn't aid that goal. ⚠️ In some cases using React Dev...
Read more >Survey123WebFormOptions | ArcGIS Survey123
Deprecated in version 3.14, use questionValue instead. globalId ... Set this property to true and the web form will not send data to...
Read more >Deprecations Added in Ember 3.x
As part of supporting ES5 getter computed properties, assigning computed properties directly is deprecated. You should replace these assignments with calls ...
Read more >String.prototype.link() - JavaScript - MDN Web Docs
Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’ve removed the suggestions in this thread saying you should create a custom
_app.js
that passes in the url property globally, as the reason we removed it is to be more explicit and not pass inurl
as a property, but instead you can inject therouter
usingwithRouter()
as per the deprecation. We will provide a codemod soon to updateurl
in pages to thewithRouter()
implementation automatically.One of my child components triggers the warning with
JSON.stringify( this.props )
.