MCP Apps Kit - v0.5.0
    Preparing search index...

    Function useView

    • Hook to access the current view identifier (ChatGPT only)

      Useful for multi-view widgets that need to know which view is active.

      Returns string

      Current view identifier or undefined

      function MultiViewWidget() {
      const view = useView();

      switch (view) {
      case "settings":
      return <SettingsView />;
      case "details":
      return <DetailsView />;
      default:
      return <MainView />;
      }
      }