- Forums
- react
- React Ionic Typescript Error: Property 'focus' Does Not Exist On Type 'never'.
React Ionic Typescript Error: Property \'focus\' Does Not Exist On Type \'never\'. [5325], Last Updated: Thu Aug 22, 2024
edw
Thu Aug 22, 2024
0 Comments
167 Visits
when I did a build I got this:
src/components/test/nav/Nav.tsx:9:32 - error TS2339: Property 'focus' does not exist on type 'never'.
9 nestedRefs.current[0][0].focus();
Solution: erro was at .focus()
nestedRefs.current[0][0].focus();
FROM:
const nestedRefs = useRef([[]]);
TO:
const nestedRefs = useRef<any[]>([[]]);