refactor: React container
This commit is contained in:
parent
f6d7833243
commit
74924f97ea
|
@ -308,7 +308,16 @@ const UiComponent = <Ui
|
|||
socket={socket}
|
||||
worldTime={worldTime}
|
||||
/>;
|
||||
ReactDOM.render(UiComponent, stage.ui);
|
||||
// Create UI layer for react.
|
||||
const reactContainer = window.document.createElement('div');
|
||||
reactContainer.className = 'react';
|
||||
stage.on('displaySizeChanged', () => {
|
||||
const displaySize = stage.displaySize;
|
||||
reactContainer.style.width = '100%';
|
||||
reactContainer.style.height = '100%';
|
||||
})
|
||||
stage.ui.appendChild(reactContainer);
|
||||
ReactDOM.render(UiComponent, reactContainer);
|
||||
// Debug UI.
|
||||
const debugUiNode = document.querySelector('.debug-container');
|
||||
const DebugUiComponent = <DebugUi
|
||||
|
|
Loading…
Reference in New Issue
Block a user