محمد
2 ماه پیش توسط محمد مطرح شد
0 پاسخ

ارور context در react

من نمیتونم از context در ری اکت استفاده کنم .و نمی دونم چرا این کدامه و ارور میگیره
فایل context

"Import  {createContext}  from  "./react
export  const  isContext=createContext

فایل متغیر از context

"import  {isContext} from  "./contextFill
"import  item  from  "./itemFill
} <=()=const  app
}<=()=return
<"isContext.provider  value ="wight>
</item>
<isContext.provider/>
{
{

فایل استفاده از context

"import  {useContext}  from  "./react
"import  {isContext}  from  "./contextFill
}<=()=const  item  
const  context =useContext(isContext)
}()return
<h1  style={{color:context}}>
Hello world
<h1/>
{
export  default  item

من نمی دونم چرا ارور میگیره یه ارور ۱۰ خط میگیره این ارور هستش

Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports. Check the render method of `Massage`. Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

لطفا لطفا جواب بدید


ثبت پرسش جدید

به همدیگه کمک کنیم

به محمد کمک کنید تا مشکل خودش را حل کند؛ این‌طور می‌توانیم با هم پیشرفت کنیم.

برای ارسال پاسخ لازم است وارد شده یا ثبت‌نام کنید

ورود یا ثبت‌نام