Skip to content

Commit 1166117

Browse files
committed
jbrowse: factor out usage of react-hot-loader
1 parent 4d0ca25 commit 1166117

File tree

4 files changed

+7
-49
lines changed

4 files changed

+7
-49
lines changed
Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,10 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom';
3-
import { AppContainer } from 'react-hot-loader';
43

54
import View from './Browser';
65

76
const render = () => {
8-
ReactDOM.render(
9-
<AppContainer>
10-
<View />
11-
</AppContainer>,
12-
document.getElementById('app')
13-
)
7+
ReactDOM.render(<View />, document.getElementById('app'));
148
};
159

16-
declare const module: any;
17-
18-
if (module.hot) {
19-
module.hot.accept();
20-
}
21-
2210
render();
Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom';
3-
import { AppContainer } from 'react-hot-loader';
43
import { App } from '@labkey/api';
54

65
import StandaloneSearch from '../StandaloneSearch';
76

8-
App.registerApp<any>('jbrowseSearchWebpart', (target: string, sessionId: string) => {
9-
ReactDOM.render(
10-
<AppContainer>
11-
<StandaloneSearch sessionId={sessionId} />
12-
</AppContainer>,
13-
document.getElementById(target)
14-
);
15-
}, true /* hot */);
7+
const render = (target: string, sessionId: string) => {
8+
ReactDOM.render(<StandaloneSearch sessionId={sessionId} />, document.getElementById(target));
9+
};
1610

17-
declare const module: any;
11+
App.registerApp<any>('jbrowseSearchWebpart', render, true /* hot */);
Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,10 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom';
3-
import { AppContainer } from 'react-hot-loader';
43

54
import VariantTable from './VariantTable';
65

76
const render = () => {
8-
ReactDOM.render(
9-
<AppContainer>
10-
<VariantTable />
11-
</AppContainer>,
12-
document.getElementById('app')
13-
)
7+
ReactDOM.render(<VariantTable />, document.getElementById('app'));
148
};
159

16-
declare const module: any;
17-
18-
if (module.hot) {
19-
module.hot.accept();
20-
}
21-
2210
render();
Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,10 @@
11
import React from 'react';
22
import ReactDOM from 'react-dom';
3-
import { AppContainer } from 'react-hot-loader';
43

54
import VariantTable from './VariantTable';
65

76
const render = () => {
8-
ReactDOM.render(
9-
<AppContainer>
10-
<VariantTable />
11-
</AppContainer>,
12-
document.getElementById('app')
13-
)
7+
ReactDOM.render(<VariantTable />, document.getElementById('app'));
148
};
159

16-
declare const module: any;
17-
18-
if (module.hot) {
19-
module.hot.accept();
20-
}
21-
2210
render();

0 commit comments

Comments
 (0)