fix: access the edge-label-renderer by reactflow's id
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
import { useRef } from 'react';
|
||||
import type { ReactNode } from 'react';
|
||||
import { createPortal } from 'react-dom';
|
||||
import { useStoreApi } from '../../hooks/useStore';
|
||||
import { getEdgeLabelRendererId } from '../../utils/graph';
|
||||
|
||||
function EdgeLabelRenderer({ children }: { children: ReactNode }) {
|
||||
const wrapperRef = useRef(document.getElementById('edgelabel-portal'));
|
||||
const store = useStoreApi()
|
||||
const state = store.getState()
|
||||
const wrapperRef = useRef(document.getElementById(getEdgeLabelRendererId(state.rfId)));
|
||||
|
||||
if (!wrapperRef.current) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user