February 2019
Beginner to intermediate
180 pages
4h 4m
English
Since the top-level <div /> element has a click event handler that always closes the menu, any clicks on its children also fire that top-level click event handler. To allow the menu to open (or remain open), we need to call event.stopPropagation() on click events for some of its child elements.
In ReasonReact, we can do this with the ReactEvent module:
onClick=(event => ReactEvent.Mouse.stopPropagation(event))
The ReactEvent module has submodules corresponding to each of ReactJS's synthetic events:
For more information ...
Read now
Unlock full access