feat: export configContentInject and formatToken #8197
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
我在基于antdv封装上层组件时,遇到如下两个问题:
他在esm下工作良好,但当打包umd使用cdn导入时,全局变量antd并没有暴露useConfigContextInject,我未寻找到其他获取useConfigContextInject的方式,因此希望可以antdv可以对外暴露useConfigContextInject。我尝试的暴露方式是通过ConfigProvider组件:
该api暴露方式和antd基本一致:

formatToken应该可以作为theme的工具方法,和useToken一起暴露给外部
(components/theme/index.ts):
import formatToken from './util/alias'; export default { useToken, + formatToken, defaultAlgorithm, darkAlgorithm, compactAlgorithm, };
Use: