Open Bug 1741623 Opened 3 years ago Updated 3 years ago

React refs created by useRef() are not logged correctly before the DOM is loaded

Categories

(DevTools :: Console, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: miker, Unassigned)

References

Details

Attachments

(3 files)

Attached file feature.html (deleted) —

STR

  1. Load the attached document feature.html with the DevTools closed.
  2. Press [option] + [command] + [k] to open the Web Console.

You will see that the Web Console correctly reports domRef.current = undefined but the domRef object is then logged showing that domRef.current is defined.

Confusingly, logging domRef.current again shows that the object is, in fact, still undefined:


domRef.current = undefined
domRef = > Object {.current: p + }
domRef.current = undefined


NOTE: This only happens on the first load of DevTools so reloading the page displays the values correctly.

Attached image Firefox screenshot (deleted) —

Firefox seems unsure whether domRef.current is defined or not.

Attached image Chrome screenshot (deleted) —

Chrome gets it right

Nicolas, can you find related bugs about expanding properties showing only current values.

Severity: -- → S3
Flags: needinfo?(nchevobbe)
Priority: -- → P3

Looks like an issue between cache vs live messages

(In reply to Julian Descottes [:jdescottes] from comment #3)

Nicolas, can you find related bugs about expanding properties showing only current values.

It's Bug 1505304

Flags: needinfo?(nchevobbe)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: