Open keene-dalveytech opened 1 year ago
I am facing the same problem, we need an option to stop the re-rendering, sometimes it could be problematic for component life circle management
if use heartbeat
, and always render, maybe should use filter
like this:
const { sendJsonMessage, lastMessage, readyState } = useWebSocketIO(socketUrl, {
queryParams: { token },
onMessage: patchMessage,
shouldReconnect: () => mounted.current === false,
reconnectAttempts: 5,
reconnectInterval: 1000 * 5,
filter: event => event.data !== '"pong"',
heartbeat: {
message: 'ping',
returnMessage: 'pong',
timeout: 1000 * 60 * 5,
interval: 1000 * 5,
},
});
The similar issue is #123.
i save my data in other js file, so i don't want rerender. how should i do? thanks