• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

380
Views
GroupMain.jsx:132 Uncaught TypeError: Cannot read properties of undefined (reading 'map') at GroupMain

I want to map my object's properties, in this case I want program to return first_name of admin, however it returns me error that cannot read properties of undefined.

enter image description here

    const dispatch = useDispatch();
    const {slug} = useParams();
    const {groupMain: {bio, is_public, is_visible, date_created, members_quantity, 
    location, admins_quantity}} = useSelector(getGroupMain);
    const {groupMain: {admins}} = useSelector(getGroupMain)
   console.log(admins)


<div className="row">

                            {admins.map((admin) => {
                                return (
                                    <div className="col-sm-4">
                                        <a href='/'>
                                            <div className="circle-img">
                                                <img src='/' className="img" alt="following-user-avatar"/>
                                            </div>

                                            <div className="following-username">
                                                <small>
                                                    {admin.first_name}
                                                </small>
                                                <small>
                                                    {/*{{ admin.last_name }}*/}
                                                </small>
                                            </div>
                                        </a>
                                    </div>)

                            }) }



                            <h4>No any admins yet!</h4>

                        </div>
over 3 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error