This example demonstrates the fundamental setup and usage of @ubidots/react-html-canvas.
- How to wrap your app with
UbidotsProvider - Using
useUbidotsReadyto check if the system is ready - Using
useUbidotsSelectedDeviceto get the current device - Using
useUbidotsActionsto interact with the dashboard
- Provider setup: The
UbidotsProvidermust wrap your component tree - Ready state: Always check if the system is ready before using data
- Device selection: Access the currently selected device from the dashboard
- Actions: Send commands back to the dashboard
import { BasicUsage } from './BasicUsage';
function App() {
return <BasicUsage />;
}- ✅ Provider configuration
- ✅ Ready state checking
- ✅ Device information display
- ✅ Basic dashboard actions