-
Notifications
You must be signed in to change notification settings - Fork 16
Open
Description
When I try to render a Pusher component, I receive this error:
TypeError: Cannot set property 'key' of undefined
Pusher
node_modules/pusher-js/dist/web/pusher.js:155
152 | logger_1["default"].warn("You should always specify a cluster when connecting. " + suffix);
153 | }
154 |
> 155 | this.key = app_key;
| ^ 156 | this.config = Collections.extend(DefaultConfig.getGlobalConfig(), options.cluster ? DefaultConfig.getClusterConfig(options.cluster) : {}, options);
157 | this.channels = factory_1["default"].createChannels();
158 | this.global_emitter = new dispatcher_1["default"]();
My implementation:
import Pusher from 'pusher-js';
import { setPusherClient } from 'react-pusher';
constructor(props){
super(props);
this.pusherClient = new Pusher("bf5df34b3b535a270b0a", {
cluster: "us2",
});
}
render(){
setPusherClient(this.pusherClient);
return (
<Flexbox>
<Pusher
channel="someChannel"
event="listChanged"
/>
</Flexbox>
)
}
I'm assuming this is due to instantiating setPusherClient incorrectly?
Metadata
Metadata
Assignees
Labels
No labels