React state not being changed properly when passed to child

fairly simple issue here that I cannot seem to fix. My understanding and previous practice of using react is if you want to change a state from a parent within a child, it should be passed to the child. Upon clicking on the main “Project” div, the state gets changed to ‘true’ and the modal appears, but when attempting to press the ‘X’ within ‘ProjectModal’, the state does not change to false, thus not closing the modal.
What am i missing here? i’ve done with numerous times before yet i cannot fix this issue.

Projects.tsx:

import { useState } from "react"
import { Project } from "../data/data"
import { X, Github, Earth } from "lucide-react"

interface ModalProps extends Project {
    setModal: (modal: boolean) => void,
    modal: boolean
}
export default function Projects(props: Project) {
    const [modal, setModal] = useState<boolean>(false)
    let showOrHideModal = modal ? 'inline' : 'hidden'

    return (
        <div className='relative defaultFont' onClick={() => setModal(true)}>
            <div className="absolute inset-0 bg-grey-custom z-0 rounded" style={{ transform: 'translate(5px, 5px)' }}></div>
            <div className="flex flex-col p-2 items-center text-xl bg-green-custom border border-grey-custom rounded relative text-grey-custom transition duration-150 ease-in-out hover:-translate-y-1">
                <img src={props.img} alt={props.title} className="border border-grey-custom rounded h-52 w-full object-cover" />
                <h1>{props.title}</h1>
            </div>
            <div className={showOrHideModal}>
                <ProjectModal {...props} setModal={setModal} modal={modal} />
            </div>
        </div>
    )
}

function ProjectModal(props: ModalProps) {

    return (
        <div className="fixed left-0 top-0 size-full overflow-auto bg-grey-custom/20 flex items-center justify-center defaultFont">
            <div className="bg-green-custom sticky rounded flex flex-col  items-center size-3/4 border border-grey-custom shadow-lg text-grey-custom defaultFont">
                <div className="flex items-center">
                    <h1 className="text-4xl font-bold">{props.title}</h1>
                    <X onClick={() => {
                        console.log('X clicked');
                        props.setModal(false);
                        console.log(props.modal)
                    }} />
                </div>
                <div className="flex size-full">
                    <div className="flex items-center w-1/2 mx-4 justify-center">
                        <img src={props.img2} alt={props.title} className="h-3/4 border border-grey-custom rounded" />
                    </div>
                    <div className="flex flex-col gap-4 items-center w-1/2 mx-4 justify-center">
                        <div>
                            <h2 className="text-2xl text-center font-bold">Description</h2>
                            <p>{props.description}</p>
                        </div>
                        <div className="w-full">
                            <h2 className="text-2xl text-center font-bold">Features</h2>
                            <ul>
                                <li>{props.feature1}</li>
                                <li>{props.feature2}</li>
                                <li>{props.feature3}</li>
                                <li>{props.feature4}</li>
                                <li>{props.feature5}</li>
                            </ul>
                        </div>
                        <div className="flex w-full gap-4">
                            <p className="font-bold">Tech Used:</p>
                            <div className="flex gap-4 items-center">
                                {props.tech.map((props: String, index: number) => {
                                    return <TechBlob text={props} key={index} />
                                })}
                            </div>
                        </div>
                        <div className="flex w-full gap-3">
                            <p className="font-bold">Languages:</p>
                            <div className="flex gap-4 items-center">
                                {props.languages.map((props: String, index: number) => {
                                    return <LanguageBlob text={props} key={index} />
                                })}
                            </div>
                        </div>
                        <div className="flex gap-4 w-full">
                            <div className='relative flex flex-col w-full md:w-1/2'>
                                <div className="absolute inset-0 bg-grey-custom z-0 rounded" style={{ transform: 'translate(5px, 5px)' }}></div>
                                <a href={props.git} target="_blank" className="relative bg-blue-custom rounded flex p-2 items-center gap-4 border border-grey-custom text-xl transition duration-150 ease-in-out hover:-translate-y-1"><Github />View Repo</a>
                            </div>
                            <div className='relative flex flex-col w-full md:w-1/2'>
                                <div className="absolute inset-0 bg-grey-custom z-0 rounded" style={{ transform: 'translate(5px, 5px)' }}></div>
                                <a href={props.deployed} target="_blank" className="relative bg-red-custom rounded flex p-2 items-center gap-4 border border-grey-custom text-xl transition duration-150 ease-in-out hover:-translate-y-1"><Earth />View in Browser</a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    )
}

attempted different methods of switching state, props.setModal(false), props.setModal(!props.modal)… been googling with no luck.

New contributor

cosmiqz is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật