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

Open
chenxiaofie opened this issue Apr 30, 2024 · 0 comments
Open

useContext hook优化建议 #3803

chenxiaofie opened this issue Apr 30, 2024 · 0 comments

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant