Peer.js: Line 5: 'this' is not allowed before super()
pranny opened this issue · 2 comments
pranny commented
Followed the steps of install and got this error
uncaught error Error: SyntaxError: /Users/pranav/workspace/multipeer/node_modules/react-native-multipeer/Peer.js: Line 5: 'this' is not allowed before super()
3 | export default class Peer extends EventEmitter {
4 | constructor(id, name) {
> 5 | this.id = id;
| ^
6 | this.name = name;
7 | }
8 | }
What to do?
lwansbrough commented
Quick fix is to add super() at the top of the constructor function. Wouldn't mind a PR for that if you want to contribute :)
pranny commented
Thanks. Submitted a PR.