Skip to content

Commit c8759c4

Browse files
committed
Removed all data attributes to components containers
1 parent c223c9e commit c8759c4

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

wp-react-lib/src/embedded/EmbeddedGateway.jsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,20 @@ class EmbeddedGateway extends React.Component {
4545
container = div
4646
}
4747

48+
49+
4850
if (component) {
4951
const props = {...this.props}
5052
const attrs = element.attributes
5153
for (let i = attrs.length - 1; i >= 0; i--) {
5254
props[attrs[i].name] = attrs[i].value;
5355
}
56+
57+
element.getAttributeNames().forEach((name) => {
58+
if (name.startsWith('data-')) {
59+
element.removeAttribute(name);
60+
}
61+
});
5462
const C = injectIntl(getComponent(component));
5563
if (C) {
5664
ReactDOM.createRoot(container)

0 commit comments

Comments
 (0)