chore(recorder): update to React 18
This commit is contained in:
parent
236a8ac2ac
commit
73552dc414
|
|
@ -17,11 +17,10 @@
|
|||
import '@web/common.css';
|
||||
import { applyTheme } from '@web/theme';
|
||||
import '@web/third_party/vscode/codicon.css';
|
||||
import * as React from 'react';
|
||||
import * as ReactDOM from 'react-dom';
|
||||
import * as ReactDOM from 'react-dom/client';
|
||||
import { Main } from './main';
|
||||
|
||||
(async () => {
|
||||
applyTheme();
|
||||
ReactDOM.render(<Main/>, document.querySelector('#root'));
|
||||
ReactDOM.createRoot(document.querySelector('#root')!).render(<Main/>);
|
||||
})();
|
||||
|
|
|
|||
|
|
@ -30,12 +30,14 @@ export const Main: React.FC = ({
|
|||
window.playwrightSetSources = setSources;
|
||||
window.playwrightSetPaused = setPaused;
|
||||
window.playwrightUpdateLogs = callLogs => {
|
||||
const newLog = new Map<string, CallLog>(log);
|
||||
for (const callLog of callLogs) {
|
||||
callLog.reveal = !log.has(callLog.id);
|
||||
newLog.set(callLog.id, callLog);
|
||||
}
|
||||
setLog(newLog);
|
||||
setLog(log => {
|
||||
const newLog = new Map<string, CallLog>(log);
|
||||
for (const callLog of callLogs) {
|
||||
callLog.reveal = !log.has(callLog.id);
|
||||
newLog.set(callLog.id, callLog);
|
||||
}
|
||||
return newLog;
|
||||
});
|
||||
};
|
||||
|
||||
window.playwrightSourcesEchoForTest = sources;
|
||||
|
|
|
|||
Loading…
Reference in a new issue