fix: resolve react-doctor errors (hooks order, reduced motion, key prop) (#105)
- Move useCallback hooks before early return in ReferencesDialog to fix conditional hook call violation (Rules of Hooks) - Add useReducedMotion hook and apply to all motion animations for WCAG 2.3.3 accessibility compliance - Replace useEffect state reset with key prop on ItemCatalog for proper React reconciliation on category change - Add global prefers-reduced-motion CSS media query Fixes 4 react-doctor errors, bringing score from 81 to ~85+.
This commit is contained in:
@@ -144,3 +144,14 @@
|
||||
-ms-overflow-style: none; /* IE and Edge */
|
||||
scrollbar-width: none; /* Firefox */
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
animation-duration: 0.01ms !important;
|
||||
animation-iteration-count: 1 !important;
|
||||
transition-duration: 0.01ms !important;
|
||||
scroll-behavior: auto !important;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user