Put a native DOM element in your React render tree and easily break out back into vanilla DOM.
React's virtual DOM works very well for a lot of use cases, but not all. Creating and holding onto a canvas is never straightforward, and running a frequently updating render function, e.g. to update a chart, becomes slow due to the overhead of diffing the tree. The latter case can be optimised but you need to be familiar with React and its performance characteristics to do it well. Sometimes it's easier just working directly with the DOM.
npm install --save react react-dom react-element-container
react-dom are included as peer dependencies to avoid duplicate versions of React, and as such must be installed in your project alongside
<ElementContainer/> takes a supplied DOM node and wraps it up in a
<div/> in your tree:
const body = documentbodyconst canvas = documentReactDOM
HTMLElement node to use.
MIT, see LICENSE.md for details.