Skip to content

Add generic types for the value property  #4660

@jesterstar

Description

@jesterstar

Prerequisites

What theme are you using?

antd

Is your feature request related to a problem? Please describe.

Hey there!

I need to use a custom widget to build part of the form, and I want to control the types based on the props.value. Is there any way to do that?

Image

Describe the solution you'd like

No response

Describe alternatives you've considered

I see it as a generic type usage that could be passed like this

type ComponentProps = WidgetProps<CustomType, StrictRJSFSchema, {}>;


const Component = (props: ComponentProps) => {
  const { value } = props;
  
  // value type will be **CustomType**

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureIs a feature requestneeds triageInitial label given, to be assigned correct labels and assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions