How do you implement stopPropagation for React synthesis events?

react uses event delegation to implement composite events, and events are all hung on document, so how is the stopPropagation of this composite event implemented? What"s the principle? Now that events are mounted on document, how to prevent event delivery


  1. posting code can make it easier for you to solve,
  2. still help you find an article: React stopPropagation failure

say ten thousand things. Do not manipulate dom, in React , including document.addEventListener () .
you reframe all dom operations to React components and data, and there will be no problem.


paste a code first, the same rookie floats past ~

Menu