Skip to content

Instantly share code, notes, and snippets.

@jenschr
Created Nov 2, 2021
Embed
What would you like to do?
import React from 'react';
import { useMqttState } from 'mqtt-react-hooks';
export default function Status() {
/*
* Status list
* - Offline
* - Connected
* - Reconnecting
* - Closed
* - Error: printed in console too
*/
const { connectionStatus } = useMqttState();
return <h1>{`Status: ${connectionStatus}`}</h1>;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment