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

#3 · closed · 2 comments

View on GitHub ↗

pranny

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?

Comments

lwansbrough

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

Thanks. Submitted a PR.