@ulesson-education/mind-sdk/react.
MindWidgetProvider
Creates the widget instance and provides it through React context.Widget configuration. See Configuration.
Your app tree.
MindWidgetHost
Mounts the widget into the DOM. Place it once inside the provider.MindWidgetHost forwards a ref and accepts any standard <div> attributes such as className and style, plus:
Mount a specific widget instance instead of the one from the provider.
Called if mounting fails.
useMindWidget()
Returns the widget controller — the live widget instance plus a reactive snapshot of itsstate and context. Must be called inside a MindWidgetProvider.
MindWidgetController is:
useOptionalMindWidget()
Same asuseMindWidget() but returns null instead of throwing when used outside a provider. Useful for components that may render in either context.
useMindWidgetController(config)
The lower-level hook thatMindWidgetProvider uses internally. Call it directly to manage the controller yourself without the context provider. It creates the widget once, subscribes to its snapshot, applies lmsContext updates, and destroys the widget on unmount.