// Consider using a dyamic component: Example
export const DynamicComponent = forwardRef(({ as, children, ...props }, ref) => {
const Component = as;
return (<Component ref={ref} {...props}>{children}</Component>);
});
// Use case: The TextField is a MUI component
<DynamicComponent as={TextField} />