Client component not re-rendering after imported function changes (HMR)
Unanswered
Maine Coon posted this in #help-forum
Maine CoonOP
I've been testing a flow where I have an SSR page that includes a client component. This client component simply renders an <h1> with the result of a function call — and that function just returns a string.
To my surprise, when I change the function's return value, HMR does kick in, but the client component doesn't re-render to reflect the updated result. I was expecting it to behave similarly to server components, where changing an imported function causes any dependent component to re-render.
I’ve put together a minimal reproduction here:
👉 https://github.com/tmota900/client-component-hmr-no-re-render
Before opening a bug report, I just want to make sure I’m not misunderstanding something or doing it wrong. Any insights are appreciated!
To my surprise, when I change the function's return value, HMR does kick in, but the client component doesn't re-render to reflect the updated result. I was expecting it to behave similarly to server components, where changing an imported function causes any dependent component to re-render.
I’ve put together a minimal reproduction here:
👉 https://github.com/tmota900/client-component-hmr-no-re-render
Before opening a bug report, I just want to make sure I’m not misunderstanding something or doing it wrong. Any insights are appreciated!
1 Reply
Maine CoonOP
The cause for this issue seems to be the functions name being upper case.