Consider using this ````jsx export const CodeInput = forwardRef(({ as, children, ...props }, ref) => { const Component = as; return (<Component ref={ref} {...props}>{children}</Component>); }); // Use case <CodeInput as={TextField} /> ````