Skip to content

Commit

Permalink
Add a check for root created be createRoot before creating it, preven…
Browse files Browse the repository at this point in the history
…ting console warning as existing method unsupported
  • Loading branch information
coder-karen committed Jul 24, 2024
1 parent e7a0141 commit 00a8834
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ export function tooltipsPlugin( periods ) {
*/
function init( u: uPlot, _opts: object ) {
container.classList.add( 'jb-score-tooltips-container' );

reactDom = ReactDOM.createRoot( reactRoot );
if ( ! reactDom ) {
reactDom = ReactDOM.createRoot( reactRoot );
}
reactRoot.style.position = 'absolute';
reactRoot.style.bottom = -20 + 'px';
reactRoot.style.translate = '-50% calc( 100% - 20px )';
Expand Down

0 comments on commit 00a8834

Please sign in to comment.