Expected a component class, got [object Object]

本文介绍了在使用React Native进行开发时,如何正确地导入组件。特别强调了组件命名及导入时首字母必须大写的规范,避免出现expected a component class, got [object Object]的错误。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

React Native 中遇到:expected a component class, got [object Object]
这里写图片描述
导入其他组件的时候,命名首字母要大写

import setting from './setting'//错误
import Setting from './setting'//正确
index.esm.js:1 [vue3-tree-org] 4.2.2 success runtime-core.esm-bundler.js:44 [Vue warn]: Invalid prop: type check failed for prop "modelValue". Expected Number with value 0, got String with value "". at <ElInputNumber modelValue="" onUpdate:modelValue=fn min=0 ... > at <ElFormItem label="分值" prop="points" > at <ElCol key=2 span=12 class="mb20" > at <ElRow gutter=24 > at <ElForm ref="dataFormRef" model= Object rules= Object ... > at <ElDialogContent key=0 ref_key="dialogContentRef" ref=Ref< undefined > ... > at <ElFocusTrap loop="" trapped=true focus-start-el="container" ... > at <ElOverlay custom-mask-event="" mask=true overlay-class=undefined ... > at <BaseTransition onAfterEnter=fn<afterEnter> onAfterLeave=fn<afterLeave> onBeforeLeave=fn<beforeLeave> ... > at <Transition name="dialog-fade" onAfterEnter=fn<afterEnter> onAfterLeave=fn<afterLeave> ... > at <ElDialog title="编辑" modelValue=true onUpdate:modelValue=fn ... > at <QuestionBankDialog ref="formDialogRef" onRefresh=fn > at <AsyncComponentWrapper ref="formDialogRef" onRefresh=fn > at <SystemQuestionBank onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< Proxy(Object) > key="/admin/questionBank/index" ... > at <BaseTransition mode="out-in" appear=false persisted=false ... > at <Transition name="slide-right" mode="out-in" > at <RouterView> at <LayoutParentView> at <AsyncComponentWrapper> at <ElScrollbar ref="layoutMainScrollbarRef" class="layout-main-scroll layout-backtop-header-fixed" wrap-class="layout-main-scroll" ... > at <ElMain class="layout-main" style="minHeight: calc(100% - 51px)" > at <LayoutMain ref="layoutMainRef" > at <AsyncComponentWrapper ref="layoutMainRef" > at <ElContainer class="layout-mian-height-50" > at <ElContainer class="layout-container flex-center" > at <LayoutClassic> at <AsyncComponentWrapper> at <Layout onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< Proxy(Object) > > at <RouterView> at
最新发布
05-19
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值