I have the following TypeScript object in a React project:
class ExampleClass {
name: string;
name2: string;
favouriteThing: string;
constructor(name: string, favouriteThing: string) {
this.name = name;
this.name2 = name;
this.favouriteThing = favouriteThing;
}
}
When viewing this object as part of a hook or prop in React Dev Tools, this is how it's displayed:
Only the the properties name2 and favouriteThing are displayed.
I'm able to see that name does still exist on the object by outputting it to the console:
Console output displaying 2 objects with the properties "name", "name2", and "favouriteThing"
I would expect name to be displayed along with the other properties in React Dev Tools. Is there something special/reserved about a property called name? Is there a reason why name is not displayed?