mm-react-tools
The MachineMetrics platform provides a collection of custom React hooks to simplify common operations and data management in your applications.
Installation
These hooks are included in the @machinemetrics/mm-react-tools package.
Use the mmdev Command Line Interface to start projects from templates that include this package and include other best practices for getting started.
Available Hooks
The following hooks are available in the package:
Core Hooks
- useMMAuth - Authentication and API request utilities
- useSearchParamsState - URL query parameter state management
- useApiRequest - API request handling with automatic refresh
- useProductionQuery - Production API query interface
Embedded App Hooks
- useMMAppParams - Embedded app configuration
- useMMAppCommands - Embedded app UI commands
- useMMAppInfo - Set modal title and badges for sidesheet headers
Widget Settings Hooks
- useMMAppSetting - Widget settings configuration
- useMMAppContext - Widget settings consumption
For detailed documentation and examples of each hook, please refer to the Hooks section in the sidebar.
Modals
Embedded apps can open modals for various interactions:
- Sidesheets - Slide-in panels for viewing, editing, or creating records with support for pagination and stacking
- Confirmation Dialogs - Prompts for user decisions before proceeding with actions