mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-20 07:26:19 +00:00
React 19: useRef<T>() -> useRef<T>(null) across 15 sites
React 19 dropped the no-arg useRef overload — the type-only useRef<T>() form (no initial value) is gone, every call must pass an initial value. The codebase had 15 occurrences of useRef<HTMLDivElement>() (DOM ref pattern) all flagged by tsgo as 'Expected 1 arguments, but got 0'. Mechanical sweep to useRef<HTMLDivElement>(null) — no behavior change, React still hands out a ref object with .current set to null at mount. Net tsgo error count: 57 -> 42.
This commit is contained in:
@@ -11,7 +11,7 @@ export const ChatWidgetView: FC<{}> = props =>
|
||||
{
|
||||
const { chatMessages = [], setChatMessages = null, chatSettings = null, getScrollSpeed = 6000 } = useChatWidget();
|
||||
const [ chatWindowEnabled ] = useChatWindow();
|
||||
const elementRef = useRef<HTMLDivElement>();
|
||||
const elementRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
const removeHiddenChats = useCallback(() =>
|
||||
{
|
||||
|
||||
@@ -14,7 +14,7 @@ export const ObjectLocationView: FC<ObjectLocationViewProps> = props =>
|
||||
{
|
||||
const { objectId = -1, category = -1, noFollow = false, ...rest } = props;
|
||||
const [ pos, setPos ] = useState<{ x: number, y: number }>({ x: -1, y: -1 });
|
||||
const elementRef = useRef<HTMLDivElement>();
|
||||
const elementRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
useEffect(() =>
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user