Closed prakashw3expert closed 7 years ago
I have the same problem +1
it may be related to this commit https://github.com/olofd/react-native-signalr/commit/95d8ca31ab3985099464187a6a1ed0def658370c
I will try again after updating
Should be fixed after PR.
I'm getting this issue when try to start connection in disconnected function.
Cannot set property 'createElement' of undefined
The issue is coming on this line of signalr index file
`hubConnectionFunc.start = (...args) => { window.document.createElement = () => { return { protocol, host }; }; window.location = { protocol, host }; const returnValue = originalStart.apply(hubConnectionFunc, args); window.document = undefined; return returnValue; };
I'm try to restart connection after disconnected and in app active state. My approach is that when app goes to backend, stop the connection and start connection again when app is active again.
Here is my code to integrate -
_handleAppStateChange = (nextAppState) => { if(nextAppState === 'background' && this.connectionSignalR) { this.connectionSignalR.stop(); } else if(nextAppState === 'active' && this.connectionSignalR){ this.connectionSignalR.start(); } }`