Commit ddfa20f
committed
fix: stabilize SidebarMenuSkeleton random width across re-renders
Use useState initializer instead of plain expression for Math.random()
to ensure the skeleton width remains stable for the component lifetime.
The React Compiler does not memoize impure functions like Math.random(),
causing visible flickering on re-renders.1 parent 62559a1 commit ddfa20f
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
889 | 889 | | |
890 | 890 | | |
891 | 891 | | |
892 | | - | |
893 | | - | |
| 892 | + | |
| 893 | + | |
894 | 894 | | |
895 | 895 | | |
896 | 896 | | |
| |||
0 commit comments