[Menu] Cannot read property 'length' of null
See original GitHub issueIntermittently I get this error when using a Menu component. It happens after clicking a menu item.
The line where the item is thrown is 388 of the menu/index.js:
if (focusableItems && focusableItems.current.length > 0) {
I think the fix is quite simple: focusableItems is created with useRef, so this line should be checking that focusableItems.current is not null:
if (focusableItems.current && focusableItems.current.length > 0) {
Issue Analytics
- State:
- Created 3 years ago
- Reactions:3
- Comments:19 (8 by maintainers)
Top Results From Across the Web
Cannot read property "length" from null - ServiceNow
I have written a script to find some specific content from all HTML fields from knowledge articles but getting below error when there...
Read more >[Solved] TypeError: Cannot read property 'length' of null
This error indicates that the code is trying to compute the length property on a null variable. A null variable holds no or...
Read more >Cannot read property 'length' of null - jquery - Stack Overflow
Having no idea about the nature of ajax result and what you are trying to do, here is the correct syntax for processing...
Read more >Chrome: Cannot read property 'length' of null - Google Groups
Cannot read property 'length' of null. The same page in FireFox works ok. Best regards, Zdravko. Andrew Gallant's profile photo ...
Read more >Jqgrid Error "Uncaught TypeError: Cannot Read Property ...
Jqgrid Error "Uncaught TypeError: Cannot Read Property 'length' Of Null" (Doc ID 2207846.1) · 1. Login to Siebel application using Chrome browser ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m seeing this same error but only when using usePortal property. The error seems to be different than the OP since that was already fixed. Anyone has seen this in 0.8?
That was the issue. I hade
MenuItem
directly underMenu
in the parent component which was why I was seeing the last error. All working now. Thank you!!