feat: performance 1
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import React, { useCallback, useContext, useEffect, useRef, useState } from 'react'
|
||||
import FlowContext from '@/lib/graph/flowContext'
|
||||
import { GraphContext, FlowUIContext } from '@/lib/graph/flowContext'
|
||||
import type { AppNode } from '@/lib/graph/nodeTypes'
|
||||
import { replaceNodeIdInGraph } from '@/lib/graph/flowUtils'
|
||||
|
||||
@@ -9,13 +9,14 @@ type Props = {
|
||||
}
|
||||
|
||||
export function NodeHeaderTitle({ nodeId, displayTitle }: Props) {
|
||||
const ctx = useContext(FlowContext)
|
||||
const nodes = ctx?.nodes ?? []
|
||||
const setNodes = ctx?.setNodes
|
||||
const edges = ctx?.edges ?? []
|
||||
const setEdges = ctx?.setEdges
|
||||
const renamingNodeId = ctx?.renamingNodeId ?? null
|
||||
const setRenamingNodeId = ctx?.setRenamingNodeId
|
||||
const graphCtx = useContext(GraphContext)
|
||||
const uiCtx = useContext(FlowUIContext)
|
||||
const nodes = graphCtx?.nodes ?? []
|
||||
const setNodes = graphCtx?.setNodes
|
||||
const edges = graphCtx?.edges ?? []
|
||||
const setEdges = graphCtx?.setEdges
|
||||
const renamingNodeId = uiCtx?.renamingNodeId ?? null
|
||||
const setRenamingNodeId = uiCtx?.setRenamingNodeId
|
||||
|
||||
const [inputValue, setInputValue] = useState(nodeId)
|
||||
const inputRef = useRef<HTMLInputElement>(null)
|
||||
|
||||
Reference in New Issue
Block a user