hono icon indicating copy to clipboard operation
hono copied to clipboard

jsx memo break hooks in client side

Open codehz opened this issue 1 year ago • 1 comments

What version of Hono are you using?

4.6.3

What runtime/platform is your app running on?

Bun

What steps can reproduce the bug?

const Counter = memo(function Counter() {
  const [count, setCount] = useState(0);
  return (
    <div>
      <p>Count: {count}</p>
      <button onClick={() => setCount(count + 1)}>Increment</button>
    </div>
  );
});

What is the expected behavior?

the hook should keep working after memoization (to compatible with react) on client side

What do you see instead?

click increment not working, it seems the behavior is different between hono and react, is it expected?

Additional information

No response

codehz avatar Oct 01 '24 01:10 codehz

Hi @codehz!

Thanks for the report. This is a bug, and we'll fix it.

usualoma avatar Oct 01 '24 13:10 usualoma