Minor: constructor name for SyntheticEvent subclasses
See original GitHub issueThis is a risibly minor issue, but I wanted to bring it up in case there’s a super easy fix to it. In older versions of React, doing e.constructor.name
on synthetic events would report the constructor class’ name, but right now it reports a generic Class
, due to the way SyntheticEvent is extended:
I’m in the process of bringing this small tool up to date, and I’ve upgraded from React 15.4 to React 16.4, and I get lots of Class
logs:
https://danburzo.github.io/input-methods/
(The workaround is to just assume Class = some subclass of SyntheticEvent, but it would be nice to have a more precise name?)
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
SyntheticEvent - React
This reference guide documents the SyntheticEvent wrapper that forms part of React's Event System. See the Handling Events guide to learn more.
Read more >W3C DOM4
The DOMError( name , message ) constructor must return a new DOMError ... Dispatches a synthetic event event to target and returns true...
Read more >React Flashcards - Quizlet
A React component is a function or a class which optionally accepts input and ... Because React is a small library focused on...
Read more >What does calling super() in a React constructor do?
super () will call the constructor of its parent class. This is required when you need to access some variables from the parent...
Read more >reactstrap - UNPKG
node_modules/react-dom/lib/SyntheticEvent.js",". ... { throw new TypeError('Cannot call a class as a function'); } }\n\nfunction _inherits(subClass, ...
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 Free
Top 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
e.nativeEvent.constructor.name
might also be helpful unless you’re specifically debugging React itselfIf anything easy comes to mind, I’ll make a PR, thank you!