Company logo
  • Jobs
  • Bootcamp
  • About Us
  • For professionals
    • Home
    • Jobs
    • Courses
    • Questions
    • Teachers
    • Bootcamp
  • For business
    • Home
    • Our process
    • Plans
    • Assessments
    • Payroll
    • Blog
    • Calculator

0

96
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>
7 months ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

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