lwansbrough / react-native-multipeer

Communicate over ad hoc wifi using Multipeer Connectivity

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Peer.js: Line 5: 'this' is not allowed before super()

pranny opened this issue · comments

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?

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 :)

Thanks. Submitted a PR.