Gathering detailed insights and metrics for react-shadow-dom-retarget-events-plus
Gathering detailed insights and metrics for react-shadow-dom-retarget-events-plus
Gathering detailed insights and metrics for react-shadow-dom-retarget-events-plus
Gathering detailed insights and metrics for react-shadow-dom-retarget-events-plus
npm install react-shadow-dom-retarget-events-plus
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
1 Stars
53 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Mar 04, 2023
Latest Version
1.0.13
Package Id
react-shadow-dom-retarget-events-plus@1.0.13
Unpacked Size
6.31 kB
Size
2.33 kB
File Count
3
NPM Version
6.4.1
Node Version
10.15.3
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
No dependencies detected.
fork from: react-shadow-dom-retarget-events
Fixes events for react components rendered in a shadow dom
.
When you render a react component inside shadow dom
events will not be dispatched to react.
I.e. when a user clicks in your react component nothing happens. This happens (or does not happen) with any events.
A bug is filed at #10422.
Luckily someone wrote a workaround on Stack Overflow. It works by adding vanilla JS event listeners and dispatching events to React.
This repo is based on his answer in an npm module.
yarn add react-shadow-dom-retarget-events-plus
or
npm install react-shadow-dom-retarget-events-plus --save
import retargetEvents
and call it with the shadowRoot
:
1import React from 'react'; 2import retargetEvents from 'react-shadow-dom-retarget-events-plus'; 3 4class App extends React.Component { 5 render() { 6 return <div onClick={() => alert('I have been clicked')}>Click me</div>; 7 } 8} 9 10const proto = Object.create(HTMLElement.prototype, { 11 attachedCallback: { 12 value: function() { 13 const mountPoint = document.createElement('span'); 14 const shadowRoot = this.createShadowRoot(); 15 shadowRoot.appendChild(mountPoint); 16 ReactDOM.render(<App/>, mountPoint); 17 retargetEvents(shadowRoot); 18 } 19 } 20}); 21document.registerElement('my-custom-element', {prototype: proto});
onMouseLeave
& onMouseEnter
replace by onMouseOut
& onMouseOver
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
security policy file not detected
Details
Score
Last Scanned on 2025-07-14
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More