Created
August 29, 2024 20:09
-
-
Save jahilldev/2bfb351c6e48a1dc5111ed1e99a72d54 to your computer and use it in GitHub Desktop.
React Third Party - Component to render container for third party rendered HTML markup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
- This is undocumented behaviour, and works as of React 16.x | |
- Any HTML rendered within this <div /> will not be wiped by React | |
- For example, an advert provider can output markup to this container without React removing on re-render | |
*/ | |
function ReactThirdParty() { | |
return ( | |
<div | |
dangerouslySetInnerHTML={{ __html: '' }} | |
suppressHydrationWarning | |
/> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reference: reactjs/rfcs#46 (comment)