refactor(core,composables): remove error from useNodeId
This commit is contained in:
@@ -2,12 +2,5 @@ import { inject } from 'vue'
|
|||||||
import { NodeId } from '../context'
|
import { NodeId } from '../context'
|
||||||
|
|
||||||
export function useNodeId() {
|
export function useNodeId() {
|
||||||
const nodeId = inject(NodeId, null)
|
return inject(NodeId, null)
|
||||||
|
|
||||||
if (!nodeId) {
|
|
||||||
// todo: emit error through hook
|
|
||||||
throw new Error('useNodeId must be called inside a Node component')
|
|
||||||
}
|
|
||||||
|
|
||||||
return nodeId
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user