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 Tooltip component (added in #871) uses a lot of the USWDS vanilla JS source code. Since we're using React to build components, we can replace most (if not all) of that with React features, such as useState, useRef, useEffect, in order to follow React best practices and write declarative code instead of imperative.
Suggested changes:
Replace the setPositionClass and positionXYZ functions with state values for storing the position and style attributes (which can be updated when the Tooltip is opened)
Apply custom classes to the trigger and wrapper elements in the Tooltip component (instead of inside the useTooltip hook)
The text was updated successfully, but these errors were encountered:
The Tooltip component (added in #871) uses a lot of the USWDS vanilla JS source code. Since we're using React to build components, we can replace most (if not all) of that with React features, such as
useState, useRef, useEffect
, in order to follow React best practices and write declarative code instead of imperative.Suggested changes:
setPositionClass
andpositionXYZ
functions with state values for storing the position and style attributes (which can be updated when the Tooltip is opened)useTooltip
hook)The text was updated successfully, but these errors were encountered: