0

// the trigger button for modal;

        <div className="container">
            <div className="interior">
                <Link className="btn" to={"#open-modal"}> Basic CSS-Only Modal</Link>
            </div>
        </div>

// The modal;

            <div id="open-modal" className="modal-window">
                <div>
                    <Link to={"#"} title="Close" className="modal-close">Close</Link>
                    <h1>Modal Title</h1>
                    <div>Lorem ipsum dolor, sit amet consectetur adipisicing elit. Eum temporibus aperiam                           doloribus nisi blanditiis? Esse quae ipsam aliquid consequatur explicabo debitis tempora voluptas                repellendus rerum unde enim, sequi ullam recusandae?
                    </div>
                </div>
            </div>

I just want to trigger the modal but it's not working with React Router but when i tried this with simple HTMl tags like "" and "href" attribute, it worked perfectly. But it's not working with Link and to even my all imports are good. I also tried giving id to "to" attribute without hash "#" but it didn't worked

TylerH
  • 20,799
  • 66
  • 75
  • 101
  • What do you mean by "trigger"? Please provide a https://stackoverflow.com/help/minimal-reproducible-example – Lin Du Dec 30 '22 at 03:09

0 Answers0