I have issue React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: object. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

This issue has been created since 2022-09-12.

Plz help me to solve this

This is my feed.jsx file

import React,{useState,useEffect} from 'react';
import { useParams } from 'react-router-dom';

import { client } from '../client';
import { feedQuery, searchQuery } from '../utils/data';

import MasonryLayout from './MasonryLayout';
import Spinner from './Spinner';

const Feed = () => {
const [pins, setPins] = useState();
const [loading, setLoading] = useState(false);
const { categoryId } = useParams();

useEffect(() => {
if (categoryId) {
setLoading(true);
const query = searchQuery(categoryId);
client.fetch(query).then((data) => {
setPins(data);
setLoading(false);
});
} else {
setLoading(true);

  client.fetch(feedQuery).then((data) => {
    setPins(data);
    setLoading(false);
  });
}

}, [categoryId]);

if (loading) return

return (


Feed

)
}

export default Feed

This is MasonryLayout.jsx file

import React from 'react';
import Masonry from 'react-masonry-css';
import Pin from './Pin';

const breakpointObj = {
default: 4,
3000: 6,
2000: 5,
1200: 3,
1000: 2,
500: 1,
};

const MasonryLayout= ({ pins })=> (

{pins?.map((pin) => )}

);

export default MasonryLayout;

When i put simply "Feed" in return in feed.jsx file it is okay but when i put

** {pins &&

}**

It show empty page

![Screenshot from 2022-09-12 21-46-09](https://user-images.githubusercontent.com/100952840/189730151-32dddfb9-0ce8-483d-8630-e9f8b20d7b
Screenshot from 2022-09-12 21-47-06
03.png)

Screenshot from 2022-09-12 21-46-09

rickhanlonii wrote this answer on 2022-09-12

I think it's because MasonryLayout renders undefined when pins is undefined (which it is on the first render), but we don't typically handle support requests filed as GitHub issues. I suggest posting to StackOverflow if that doesn't help:

https://stackoverflow.com/questions/tagged/react

More Details About Repo
Owner Name facebook
Repo Name react
Full Name facebook/react
Language JavaScript
Created Date 2013-05-24
Updated Date 2022-09-27
Star Count 195296
Watcher Count 6655
Fork Count 40431
Issue Count 1113

YOU MAY BE INTERESTED

Issue Title Created Date Comment Count Updated Date
issue with loading names from the gym holder 3 2016-12-05 2022-09-06
Manual Captcha Solver 0 2016-12-05 2022-09-06
ObjectifyFilter and Ktor 0 2021-04-30 2022-07-26
Service seems offline 3 2021-03-13 2022-09-01
CSS minification breaks CSS 2 2021-03-04 2022-08-06
Raw githack for GitLab is down today? 1 2021-03-26 2022-09-03
Add parameter: number of activities by month/year 0 2022-05-14 2022-08-12
undefined behaviour when used in a parallel environment 8 2021-11-25 2022-07-20
[improvement] Allow row duplication using the local menu 0 2021-12-22 2022-08-01
Can't export instrument in DDSP-VST 0 2022-07-18 2022-08-10
Any plan to support MySQL8.0? 2 2020-08-16 2022-07-20
Regex image selection shouldn't fallback if explicitely set 1 2020-11-22 2022-09-19
SA1516 doesn't report missing blank line after file scoped namespace 1 2022-05-20 2022-09-15
API Question Client: How to receive the used SecurityPolicy 4 2021-12-09 2022-09-11
[react] [theme] Component form error message 0 2021-07-27 2022-09-02
Messages containing quotes are completely blank 2 2022-03-25 2022-09-02
Copy the CSS, HTML code 3 2021-09-08 2022-09-13
Decorator not applied in some projected cases 0 2022-08-29 2022-09-24
MNT: Delete stale branches? 4 2021-03-09 2022-08-05
crash by jei recipe (+) to ME, by Charm Belt recipe 3 2022-06-25 2022-07-07
Clicking on an achievement crashed the game. 2 2022-06-25 2022-09-27
Create a preview system for the smart CDN 0 2022-07-13 2022-08-17
How to perform `curl --upload-file` 4 2022-04-23 2022-09-17
What is the actual license of this site: MIT or CC0? 1 2021-03-13 2022-07-29
Add pid.codes as vendor in metadata 1 2021-11-13 2022-07-18
GL API Errors on AMD FOSS drivers 11 2015-06-23 2022-09-13
Styles sidebar: Comment pagination inner blocks have the same button text as Query pagination inner blocks 1 2022-09-06 2022-09-09
Fix click management when navigation selector is busy 0 2022-09-06 2022-09-09
Panic with LANG=C.UTF-8 6 2022-07-21 2022-09-09
Bug: Incorrect document language selected 1 2021-12-28 2022-07-23
LidarPointDensity crashes QGIS when run inside Model Builder GUI 3 2022-05-26 2022-09-06
Tesla foxy unexpected keyword argument 'controller_class' 7 2021-03-08 2022-09-25
Model:TS0505B. Vendor:_TZ3210_remypqqm. Tuya 12w Bulb 1 2021-12-20 2022-09-13
Expose switch as light doesn't do nothing in Home assistant 7 2021-12-20 2022-08-24
Issue with WPML 2 2020-04-06 2021-12-23
weheartit.com 0 2021-11-20 2021-12-26
Inline Editor will announce "Space" or "New Line" 1 2021-09-08 2022-09-24
jOOQ returning() SQL generated for MSSQL can cause truncation? 7 2022-08-22 2022-09-12
OrientDb: Upgrade client and update impl to resolve deprecated calls 0 2021-05-13 2022-08-15
rasing my binary failed :( 1 2022-03-01 2022-09-18
Two usb devices could not detect/choosen 1 2021-02-24 2022-09-18
can the frame buffer conversion hack be added so the Harry Potter games can be playable? 5 2021-07-11 2022-09-07
Mobile/touch disable 2 2019-05-19 2022-07-17
当设置系统菜单为顶部菜单时,再次打开网页网页头部的用户和设置按钮消失,而且菜单还是左侧的 1 2021-09-10 2022-08-08
[2022] Failed to sync with Github options 6 2022-02-22 2022-07-20
Updated readme 1 2016-12-18 2021-12-19
Thunderbird 68 missing 2 2019-09-11 2022-09-26
Toast z-index css variable not used 2 2022-09-13 2022-09-26
Expose range values of other fields to coordinating nodes 3 2021-12-07 2022-08-05
storage/objects: TestObjectBucketLock failed 1 2021-10-09 2022-08-27