useConnection
useConnection
フックは、アクティブな接続インタラクションがある場合、現在の接続を返します。接続インタラクションがアクティブでない場合、すべてのプロパティに対して null
を返します。このフックの典型的なユースケースは、特定の条件(例えば、接続が有効かどうか)に基づいてハンドルを着色することです。
<script lang="ts">
import { useConnection } from '@xyflow/svelte';
const connection = useConnection();
</script>
シグネチャ
名前 | 型 |
---|---|
#戻り値 |
|
Connection |