D
D
danilr2020-01-18 16:42:27
React
danilr, 2020-01-18 16:42:27

How to remove an event in a nested element?

<li
                key={name}
                onClick={clickHandler}
            >
                <div onMouseDown={this.mouseDown} onMouseUp={this.mouseUp} className="door" style={style}/>
                <a
                    className="menu-link"
                >
                    <span className="icon-container">{icon()}</span>
                </a>
            </li>

A click event is hung on the outer li, but I need it to not work in one of the blocks - when you click on it. On a div with a class of "door" I don't need the clickHandler method to fire. How to do it?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question