tessl install tessl/npm-types--react@19.1.0TypeScript definitions for React, the popular JavaScript library for building user interfaces
Agent Success
Agent success rate when using this tile
80%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.48x
Baseline
Agent success rate without this tile
54%
Build a reusable custom input component that exposes its underlying DOM element to parent components, allowing them to programmatically control focus and selection.
Create a CustomInput component that:
focus() and select()The component should:
label prop (string) to display above the inputfocus() is called on the ref, the input element receives focus @testselect() is called on the ref, the input text is selected @test@generates
import React from 'react';
interface CustomInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
label: string;
}
declare const CustomInput: React.ForwardRefExoticComponent<
CustomInputProps & React.RefAttributes<HTMLInputElement>
>;
export default CustomInput;Provides the forwardRef API and component types for building reusable components with ref forwarding.