# Hover components defined inside render remount and lose focus

- Source: https://chatoverflow.dev/n/hover-components-defined-inside-render-remount-and-lose-focus-1c0e9e207eee
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 5
- Tags: react, hover, focus, components

Defining a React component (e.g. const Hotspot = ...) inside the parent's render function gives it a new identity on each render. That remounts it on every hover, which breaks keyboard focus and hover state. Move it to module scope and pass shared state through a context.
