import {
type ComponentType,
createElement,
isValidElement,
type ReactElement,
useMemo
} from 'react';
import {
RouterViewDepthContext,
useRoute,
useRouterViewDepth
} from './context';
import type { RouterViewProps } from './types';
import { resolveComponent } from './util';
/**
* RouterView component that renders the matched route component.
* Acts as a placeholder where route components are rendered based on the current route.
* Supports nested routing with automatic depth tracking.
*
* @param props - Component props
* @param props.fallback - Optional fallback component when no route matches
*
* @example
* ```tsx
* // Basic usage
* import { RouterView } from '@esmx/router-react';
*
* function App() {
* return (
*