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
The component has 3 HTML elements: a _span_ element with __tabindex__ attribute, a _p_ element with __tabindex__ attribute and a _button_ element. It renders also the current _active element_. If element focused changes, _active element_ displayed will change.
5
5
*/
6
6
exportconstUseActiveElement=()=>{
7
7
constactiveElement=useActiveElement();
8
-
console.log("render",activeElement?.tagName)
9
8
10
9
return(<>
11
10
<p>Active element is: {activeElement?.tagName}</p>
12
11
<divstyle={{display: "grid",gridTemplateColumns: "auto auto auto",justifyContent: "center",gap: 50}}>
> The component has 3 HTML elements: a _span_ element with __tabindex__ attribute, a _p_ element with __tabindex__ attribute and a _button_ element. It renders also the current active element. If element focused changes, active element displayed will change.
0 commit comments