ant-design / ant-design/pro-components

How to pass external form instance to StepsFormComponent? (It seems not working)

Open
#8,791 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
4.8k
Forks
1.4k
Avg merge
10h 44m
Merged PRs (30d)
3

Description

### 🧐 问题描述

Trying to pass form instance returned by useForm hook to StepsForm component.
According to [this comment](https://github.com/ant-design/pro-components/issues/7834#issuecomment-1873326662) StepsForm should support external instance, but it's don't.

(pro-components v2.7.9)

### 🚑 其他信息

image
Neither type suggest (prop in StepsForm interface) and instance not working.
Here i want to watch props in all steps with Form.useWatch, but I cant cause when using useFormInstance hook in nested steps - parent StepsForm dont know about steps states. Also form prop in FormStep (not Steps) is not declared in interface, but working

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the reported useForm, StepsForm, and nested FormStep setup against pro-components v2.7.9, then inspect the StepsForm and FormStep interfaces and their form-instance handling. Done means the external instance is accepted by the types, works at runtime, and allows Form.useWatch to observe state across steps.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.