import { Dialogic } from "dialogic" ; import { useEffect } from "react" ; import { useDialogicState } from "./useDialogicState" ; import { Wrapper } from "./Wrapper" ; import React from "react" ; type Props = { instance : Dialogic . DialogicInstance ; } & Dialogic . ComponentOptions ; export const Dialogical = ( { instance , ... props } ) => { useDialogicState ( ) ; const identityOptions = { id : props . id || instance . defaultId , spawn : props . spawn || instance . defaultSpawn , } ; useEffect ( ( ) => { if ( typeof props . onMount === "function" ) { props . onMount ( ) ; } } , [ ] ) ; return < Wrapper identityOptions = { identityOptions } ns = { instance . ns } / > ; } ;