import React, { PropsWithChildren } from 'react' import { hasComponent, removeComponent } from '@xrengine/engine/src/ecs/functions/ComponentFunctions' import { dispatchAction } from '@xrengine/hyperflux' import { useEditorState } from '../../services/EditorServices' import { SelectionAction } from '../../services/SelectionServices' import PropertyGroup from './PropertyGroup' import { EditorPropType } from './Util' //declaring NodeEditorProps type NodeEditorProps = EditorPropType & { description?: string name?: string } /** * NodeEditor component used to render editor view. * * @type {class component} */ export const NodeEditor: React.FC> = ({ description, children, name, entity, component }) => { const editorState = useEditorState() return ( { dispatchAction(SelectionAction.forceUpdate({})) removeComponent(entity, component) } : undefined } > {children} ) } export default NodeEditor