Open natembennett opened 5 years ago
Thanks for opening this issue!
setPusher
only needs to be called once in the application's lifetime. Try moving the call outside of render to see if it fixes the problem
setPusher
only needs to be called once in the application's lifetime. Try moving the call outside of render to see if it fixes the problem
Even in event componentDidMount or componentDidUpdate life cycles functions the still persist.
It's not necessary to couple the instantiation of the pusher client to a component / it's lifecycle.
Try calling it in the application driver, such as before you call ReactDom.Render
.
It's not necessary to couple the instantiation of the pusher client to a component / it's lifecycle. Try calling it in the application driver, such as before you call
ReactDom.Render
.
The only solution for me is was removing the:
<Pusher
channel="someChannel"
event="listChanged"
/>
And work as the documentation recommended. The component is not working at all, and some channels is dynamic and I need pass some id or specific so I need to initiate after the componentDidUpdate life cycle.
And even calling before of ReactDom.render the issue persist.
For me at least was better working with pure JavaScript and stop calling as component.
When I try to render a Pusher component, I receive this error:
TypeError: Cannot set property 'key' of undefined
My implementation:
I'm assuming this is due to instantiating setPusherClient incorrectly?