You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[v6.0.0-beta] No longer working with React StrictMode #295
Would you be able to help look into this @Dylan-fa?
It means the header useEffect() hook is managing to call new Header() from NHS.UK frontend a second time. I've seen it in development, but that's just because Next.js Fast Refresh can forcibly clear state
Activity
colinrotherham commentedon Oct 21, 2025
Would you be able to help look into this @Dylan-fa?
It means the header
useEffect()hook is managing to callnew Header()from NHS.UK frontend a second time. I've seen it in development, but that's just because Next.js Fast Refresh can forcibly clear stateSee if you can find a better solution? 🙏
nhsuk-react-components/src/components/navigation/header/Header.tsx
Lines 42 to 64 in 1704807
colinrotherham commentedon Oct 21, 2025
It could be the dynamic
import()Promise is still resolving between renders?colinrotherham commentedon Oct 21, 2025
It was a couple of things:
import('nhsuk-frontend')so it ran twiceuseState()foruseRef()to preserve the HTML element handle between rendersIf you can give #296 a test?
Dylan-fa commentedon Oct 24, 2025
Yep I built this PR locally and it fixes the StrictMode issue.
colinrotherham commentedon Oct 27, 2025
Thanks again. You can give this a try in v6.0.0-beta.3