3 ms·
They don't do the event normalization/redirection. This is something you probably won't notice or need in your project anyways. I myself encountered the differe
by littlecranky67 6y ago
They don't do the event normalization/redirection. This is something you probably won't notice or need in your project anyways. I myself encountered the difference just once, when using Portals: In React, all events inside the portal would bubble/propagate to the parent components of the React component tree just as if the portal was mounted as a child of the surrounding component. In preact, all events in the portal propagate to the actual, real browser DOM hierarchy. I.e. if you have a click event inside the portal, the wrapping Preact parent component would never see the event or be able to handle this. This incompatibility would only be an issue when migrating to Preact from React; if you start with Preact from the beginning you would refrain from using this event bubbling to notify the enclosing component and use some other mechanism (i.e. forward the event data through a custom event handler or PubSub instance).