Skip to content

feat: getComponent 找不到组件时, 添加错误提醒#2325

Merged
hiyuki merged 6 commits into
masterfrom
fix-getcomponent-error
Nov 17, 2025
Merged

feat: getComponent 找不到组件时, 添加错误提醒#2325
hiyuki merged 6 commits into
masterfrom
fix-getcomponent-error

Conversation

@yandadaFreedom
Copy link
Copy Markdown
Collaborator

No description provided.

@yandadaFreedom yandadaFreedom changed the title feat: getComponent报错时 添加错误提醒 feat: getComponent报错时, 添加错误提醒 Nov 14, 2025
@yandadaFreedom yandadaFreedom changed the title feat: getComponent报错时, 添加错误提醒 feat: getComponent 找不到组件时, 添加错误提醒 Nov 14, 2025
component = component.__esModule ? component.default : component
if (!component) {
warn(
`${extendOptions?.displayName || ''} component not found, please check`
Copy link
Copy Markdown
Collaborator

@hiyuki hiyuki Nov 14, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error(`getComponent expected a function/class component ${extendOptions?.displayName?`[${extendOptions.displayName}] `:''}as first argument, but got undefined.`)

export function getComponent (component, extendOptions) {
component = component.__esModule ? component.default : component
if (!component) {
warn('component not found, please check')
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error(`getComponent() expected component options as first argument, but got undefined.`)

@hiyuki hiyuki merged commit 967bcb5 into master Nov 17, 2025
6 checks passed
@hiyuki hiyuki deleted the fix-getcomponent-error branch November 17, 2025 09:37
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

Successfully merging this pull request may close these issues.

2 participants