Skip to content
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

Infinite re-rendering when using webpack-hot-middleware #517

Open
plesiecki opened this issue Oct 27, 2023 · 1 comment
Open

Infinite re-rendering when using webpack-hot-middleware #517

plesiecki opened this issue Oct 27, 2023 · 1 comment

Comments

@plesiecki
Copy link

plesiecki commented Oct 27, 2023

Hello, I'd like to report an issue with HMR when using webpack-hot-middleware.

Repro

Here's the repro — https://github.com/plesiecki/preact-hmr-middlewares-repro.

Infinite re-rendering happens when I edit imported but unused component, like Test in the example below.

Example
import { h } from 'preact';

import { Test } from './Test';

export function App() {
  const boom = <Test/>;

  console.log('render App');
  return (
    <div>
      <h1>App function</h1>
    </div>
  );
}

Additional info

  • same case works with webpack-dev-server
  • it works with react + webpack-hot-middleware setup
@JoviDeCroock
Copy link
Member

We might need to do something similar to pmmmwh/react-refresh-webpack-plugin#23 to make this work as the socket integration seems different

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants