Skip to content
Snippets Groups Projects
Commit cfa8fde8 authored by Chris Beer's avatar Chris Beer
Browse files

Allow MiradorViewer to not immediately render onto the page

parent 3b1ab174
Branches
No related tags found
No related merge requests found
......@@ -10,7 +10,7 @@ describe('MiradorViewer', () => {
beforeAll(() => {
ReactDOM.render = jest.fn();
ReactDOM.unmountComponentAtNode = jest.fn();
instance = new MiradorViewer({});
instance = new MiradorViewer({ id: 'mirador' });
});
describe('constructor', () => {
it('returns viewer store', () => {
......
......@@ -25,7 +25,7 @@ class MiradorViewer {
|| createStore(getReducersFromPlugins(this.plugins), getSagasFromPlugins(this.plugins));
this.processConfig();
ReactDOM.render(
config.id && ReactDOM.render(
<Provider store={this.store}>
<HotApp plugins={this.plugins} />
</Provider>,
......@@ -48,7 +48,7 @@ class MiradorViewer {
* Cleanup method to unmount Mirador from the dom
*/
unmount() {
ReactDOM.unmountComponentAtNode(document.getElementById(this.config.id));
this.config.id && ReactDOM.unmountComponentAtNode(document.getElementById(this.config.id));
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment