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.

Fast refresh breaks when using nextjs withRouter HOC

See original GitHub issue

It seems that withRouter HOC from “next/router” starts displayName with a small letter.

if (process.env.NODE_ENV !== 'production') {
    const name =
      ComposedComponent.displayName || ComposedComponent.name || 'Unknown'
    WithRouterWrapper.displayName = `withRouter(${name})`
  }

Would it make sense to change the capital letter requirement?

https://github.com/vercel/next.js/blob/canary/packages/next/client/with-router.tsx

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
JoviDeCroockcommented, Dec 11, 2020

New version has been published, you’ll have to upgrade @prefresh/webpack to the new patch! Thanks for the detailed issue

0reactions
JoviDeCroockcommented, Dec 11, 2020

Feel free to raise a PR 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Basic Features: Fast Refresh - Next.js
Fast Refresh is a Next.js feature that gives you instantaneous feedback on edits made to your React components. Fast Refresh is enabled by...
Read more >
withAuthUser() HOC prevents Fast Refreshing / HMR #163
Fast Refresh requires at least one parent function component in your React tree.
Read more >
Nextjs - Fast Refresh throws error on any page other than index
I ran into a weird issue with my recent Nextjs build that I cannot figure out. Any page other than the index.js page...
Read more >
Client-Side Routing In Next.js - Smashing Magazine
Routing is the process through which the user is navigated to different pages on a website. Rendering is the process of putting those...
Read more >
refresh the page next js Code Example
how to redirect programatically in nextjs · react router next page top · how to reload page with router next js · refresh...
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