File tree Expand file tree Collapse file tree 8 files changed +30
-39
lines changed
jbrowse/src/client/JBrowse Expand file tree Collapse file tree 8 files changed +30
-39
lines changed Original file line number Diff line number Diff line change 1- import React from 'react' ;
2- import ReactDOM from 'react-dom' ;
3-
41import View from './Browser' ;
2+ import { createRoot } from 'react-dom/client' ;
3+ import React from 'react' ;
54
65// Need to wait for container element to be available in labkey wrapper before render
76window . addEventListener ( 'DOMContentLoaded' , ( event ) => {
8- ReactDOM . render ( < View /> , document . getElementById ( 'app' ) )
7+ createRoot ( document . getElementById ( 'app' ) ) . render ( < View /> )
98} ) ;
Original file line number Diff line number Diff line change 1- import React from 'react' ;
2- import ReactDOM from 'react-dom' ;
3-
41import View from './Browser' ;
2+ import { createRoot } from 'react-dom/client' ;
3+ import React from 'react' ;
54
6- const render = ( ) => {
7- ReactDOM . render ( < View /> , document . getElementById ( 'app' ) ) ;
8- } ;
9-
10- render ( ) ;
5+ // Need to wait for container element to be available in labkey wrapper before render
6+ window . addEventListener ( 'DOMContentLoaded' , ( event ) => {
7+ createRoot ( document . getElementById ( 'app' ) ) . render ( < View /> )
8+ } , true ) ;
Original file line number Diff line number Diff line change 11import React from 'react' ;
2- import ReactDOM from 'react-dom' ;
2+ import { createRoot } from 'react-dom/client ' ;
33import { App } from '@labkey/api' ;
44
55import StandaloneSearch from '../StandaloneSearch' ;
66
77App . registerApp < any > ( 'jbrowseSearchWebpart' , ( target : string , sessionId : string ) => {
8- ReactDOM . render (
9- < StandaloneSearch sessionId = { sessionId } />
10- , document . getElementById ( target ) ) ;
11- } ) ;
8+ createRoot ( document . getElementById ( target ) ) . render ( < StandaloneSearch sessionId = { sessionId } /> )
9+ } ) ;
Original file line number Diff line number Diff line change 11import React from 'react' ;
2- import ReactDOM from 'react-dom' ;
2+ import { createRoot } from 'react-dom/client ' ;
33import { App } from '@labkey/api' ;
44
55import StandaloneSearch from '../StandaloneSearch' ;
66
7- const render = ( target : string , sessionId : string ) => {
8- ReactDOM . render ( < StandaloneSearch sessionId = { sessionId } /> , document . getElementById ( target ) ) ;
9- } ;
10-
11- App . registerApp < any > ( 'jbrowseSearchWebpart' , render , true /* hot */ ) ;
7+ App . registerApp < any > ( 'jbrowseSearchWebpart' , ( target : string , sessionId : string ) => {
8+ createRoot ( document . getElementById ( target ) ) . render ( < StandaloneSearch sessionId = { sessionId } /> )
9+ } , true ) ;
Original file line number Diff line number Diff line change 11import React from 'react' ;
2- import ReactDOM from 'react-dom' ;
32
43import VariantTable from './VariantTable' ;
4+ import { createRoot } from 'react-dom/client' ;
55
66// Need to wait for container element to be available in labkey wrapper before render
77window . addEventListener ( 'DOMContentLoaded' , ( event ) => {
8- ReactDOM . render ( < VariantTable /> , document . getElementById ( 'app' ) )
8+ createRoot ( document . getElementById ( 'app' ) ) . render ( < VariantTable /> )
99} ) ;
Original file line number Diff line number Diff line change 11import React from 'react' ;
2- import ReactDOM from 'react-dom' ;
32
43import VariantTable from './VariantTable' ;
4+ import { createRoot } from 'react-dom/client' ;
55
6- const render = ( ) => {
7- ReactDOM . render ( < VariantTable /> , document . getElementById ( 'app' ) ) ;
8- } ;
9-
10- render ( ) ;
6+ // Need to wait for container element to be available in labkey wrapper before render
7+ window . addEventListener ( 'DOMContentLoaded' , ( event ) => {
8+ createRoot ( document . getElementById ( 'app' ) ) . render ( < VariantTable /> )
9+ } , true ) ;
Original file line number Diff line number Diff line change 11import React from 'react' ;
2- import ReactDOM from 'react-dom' ;
32
43import VariantTable from './VariantTable' ;
4+ import { createRoot } from 'react-dom/client' ;
55
66// Need to wait for container element to be available in labkey wrapper before render
77window . addEventListener ( 'DOMContentLoaded' , ( event ) => {
8- ReactDOM . render ( < VariantTable /> , document . getElementById ( 'app' ) )
8+ createRoot ( document . getElementById ( 'app' ) ) . render ( < VariantTable /> )
99} ) ;
Original file line number Diff line number Diff line change 11import React from 'react' ;
2- import ReactDOM from 'react-dom' ;
32
43import VariantTable from './VariantTable' ;
4+ import { createRoot } from 'react-dom/client' ;
55
6- const render = ( ) => {
7- ReactDOM . render ( < VariantTable /> , document . getElementById ( 'app' ) ) ;
8- } ;
9-
10- render ( ) ;
6+ // Need to wait for container element to be available in labkey wrapper before render
7+ window . addEventListener ( 'DOMContentLoaded' , ( event ) => {
8+ createRoot ( document . getElementById ( 'app' ) ) . render ( < VariantTable /> )
9+ } , true ) ;
You can’t perform that action at this time.
0 commit comments