update(types): Connection target and source as non-nullable strings
* Required for a valid edge, so it should be required in a connection as well
This commit is contained in:
@@ -26,7 +26,7 @@ export const checkElementBelowIsValid = (
|
||||
const result: Result = {
|
||||
elementBelow,
|
||||
isValid: false,
|
||||
connection: { source: null, target: null, sourceHandle: null, targetHandle: null },
|
||||
connection: { source: '', target: '', sourceHandle: null, targetHandle: null },
|
||||
isHoveringHandle: false,
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ export const checkElementBelowIsValid = (
|
||||
}
|
||||
|
||||
result.connection = connection
|
||||
result.isValid = isValidConnection(connection)
|
||||
result.isValid = isValidConnection(connection) || !result.connection.target || !result.connection.source
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -14,9 +14,9 @@ export enum ConnectionLineType {
|
||||
/** Connection params that are passed when onConnect is called */
|
||||
export interface Connection {
|
||||
/** Source node id */
|
||||
source: string | null
|
||||
source: string
|
||||
/** Target node id */
|
||||
target: string | null
|
||||
target: string
|
||||
/** Source handle id */
|
||||
sourceHandle: string | null
|
||||
/** Target handle id */
|
||||
|
||||
Reference in New Issue
Block a user