Skip to content

Form.useInjectFormItemContext is not a function error #6006

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task
fayeah opened this issue Oct 6, 2022 · 8 comments
Closed
1 task

Form.useInjectFormItemContext is not a function error #6006

fayeah opened this issue Oct 6, 2022 · 8 comments
Labels
🤔 Need Reproduce We cannot reproduce your problem outdated

Comments

@fayeah
Copy link

fayeah commented Oct 6, 2022

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

2.2.6

Environment

chrome

Reproduction link

https://github.com/vueComponent/ant-design-vue/blob/cb3c002e17f0f4f5b3e8d01846069da0e2645aff/components/form/demo/price-input.vue

Steps to reproduce

  1. create a customized selector component and use const formItemContext = Form.useInjectFormItemContext();
  2. use it in a parent component;
  3. refresh the page and infinite loop error occurs, Form.useInjectFormItemContext is not a function error

What is expected?

can create customized selector component successfully.

What is actually happening?

error occurs


reference the documentation mentioned: https://antdv.com/components/form/#Form, "Customized Form Controls"
part.

@fayeah
Copy link
Author

fayeah commented Oct 6, 2022

补充说明:
Pasted Graphic

@fayeah
Copy link
Author

fayeah commented Oct 6, 2022

related issues: #5667

@tangjinzhou
Copy link
Member

如果用的 2.x 版本,请升级3.x
如果是3.x也有问题,请提供复现示例

@tangjinzhou tangjinzhou added the 🤔 Need Reproduce We cannot reproduce your problem label Oct 8, 2022
@github-actions
Copy link

github-actions bot commented Oct 8, 2022

Hello @fayeah. Please provide a online reproduction by forking this link for vue2link for vue3 or a minimal GitHub repository. Make sure to choose the correct version.

你好 @fayeah, 我们需要你提供一个在线的重现实例以便于我们帮你排查问题。你可以通过点击 此处 for vue2此处 for vue3 创建一个 codesandbox 或者提供一个最小化的 GitHub 仓库。请确保选择准确的版本。

@github-actions
Copy link

Since the issue was labeled with Need Reproduce, but no response in 7 days. This issue will be closed. If you have any questions, you can comment and reply.

由于该 issue 被标记为需要复现信息,却 7 天未收到回应。现关闭 issue,若有任何问题,可评论回复。

@IHongTaoI
Copy link

补充说明: Pasted Graphic

你是否用了 unplugin-vue-components 插件

@whateveryoudo
Copy link

补充说明: Pasted Graphic

你是否用了 unplugin-vue-components 插件

我也出现了,开发不报错,build报错,找不出原因,新启一个项目又没问题,目前 将“useInjectFormItemContext” 导入修改成
'ant-design-vue/lib/form/FormItemContext'

Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🤔 Need Reproduce We cannot reproduce your problem outdated
Projects
None yet
Development

No branches or pull requests

4 participants