Skip to content
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

useContext hook优化建议 #3803

Closed
chenxiaofie opened this issue Apr 30, 2024 · 1 comment
Closed

useContext hook优化建议 #3803

chenxiaofie opened this issue Apr 30, 2024 · 1 comment

Comments

@chenxiaofie
Copy link

Subject of the feature

Problem

我在尝试把Basic form这些组件抽离出来组成一个组件库的时候碰到了一个警告
inject() can only be used inside setup() or functional components.
然后我根据控制台提供的调用堆栈 发现了警告在useContext.ts这个hook当中
这个问题在开发环境的时候不会出现 打包后就出现了

Expected behaviour

What should happen? Please describe the desired behaviour.

Alternatives

是否可以使用Map来替代Vue3的provide和inject?

@anncwb
Copy link
Collaborator

anncwb commented Jun 30, 2024

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

@anncwb anncwb added the Stale label Jun 30, 2024
@anncwb anncwb closed this as completed Jul 8, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Aug 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants