CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/npm-types--react

tessl install tessl/npm-types--react@19.1.0

TypeScript 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%

task.mdevals/scenario-6/

Flexible Component Wrapper System

Build a reusable component wrapper system that provides consistent layout and behavior for different types of child components.

Requirements

Create a TypeScript module that exports wrapper components with properly typed props that work seamlessly with various child components.

Card Component

Build a Card wrapper component that:

  • Accepts children elements to render inside the card
  • Accepts an optional variant prop that can be "default" or "bordered"
  • Accepts an optional padding prop that can be "small", "medium", or "large"
  • Uses correct TypeScript types so the component accepts children and these variant props

Button Wrapper

Build a ButtonWrapper component that:

  • Wraps a standard HTML button element
  • Accepts all the props that a native button element accepts (like onClick, disabled, type, etc.)
  • Adds an additional optional icon prop of type string
  • Passes through all button props to the underlying button element
  • Uses correct TypeScript types to ensure type safety

Test Cases

  • When Card receives children, it renders them correctly @test
  • When Card receives variant="bordered", it applies the bordered class @test
  • ButtonWrapper accepts standard button props like onClick and disabled @test
  • ButtonWrapper with icon prop renders both icon and children @test

Implementation

@generates

API

export function Card(props: /* YOUR TYPE HERE */): JSX.Element;

export function ButtonWrapper(props: /* YOUR TYPE HERE */): JSX.Element;

Dependencies { .dependencies }

@types/react { .dependency }

Provides TypeScript type definitions for React.

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/@types/react@19.1.x
tile.json