You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a Chrome extension that injects data into the current page. Chrome extensions have a concept of a "content script" which has access to the page's DOM but not any of the page's JavaScript variables. This means I can include React for that page's DOM but there may already be React running on the page, and there won't be any conflicts in the code. However, with two copies of React running I ran into Uncaught Error: Invariant Violation: ReactMount: Two valid but unequal nodes with the samedata-reactid: .0.0.2 for obvious reasons.
My solution was to modify my extension's version of React to change DOMProperty.ID_ATTRIBUTE_NAME to data-extensionreactid to avoid these conflicts. Is there a better way than modifying React's source?