I have followed the examples for ES6 here.
My code:
import {EventEmitter} from 'react-native';
class A extends EventEmitter {
constructor() {
super();
}
}
export const a = new A();
When I run this in my React Native app (RN 0.68), I get the following message, and a red error screen in the app:
ERROR TypeError: Super expression must either be null or a function
Importing the EventEmitter
from the right place solved my problem
import {EventEmitter} from 'events';