File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121 "@babel/preset-react" : " ^7.13.13" ,
2222 "chess.js" : " ^0.11.0" ,
2323 "parcel-plugin-svelte" : " ^4.0.6" ,
24- "react" : " ^17.0.2 " ,
25- "react-dom" : " ^17.0.2 " ,
24+ "react" : " ^18.2.0 " ,
25+ "react-dom" : " ^18.2.0 " ,
2626 "react-router-dom" : " ^5.2.0" ,
2727 "superagent" : " ^6.1.0" ,
2828 "svelte" : " ^3.37.0" ,
Original file line number Diff line number Diff line change 11import React from 'react' ;
2- import { render } from 'react-dom' ;
2+ import { createRoot } from 'react-dom/client ' ;
33import { App } from './app' ;
44
5- render (
6- < App /> ,
7- document . getElementById ( 'test' ) || document . createElement ( 'div' )
5+ const container =
6+ document . getElementById ( 'test' ) || document . createElement ( 'div' ) ;
7+ const root = createRoot ( container ) ;
8+ root . render (
9+ < React . StrictMode >
10+ < App />
11+ </ React . StrictMode >
812) ;
Original file line number Diff line number Diff line change 33 export let clientManager;
44 export let ToggleVisibility;
55
6+ import { onDestroy } from ' svelte' ;
67 import JSONTree from ' svelte-json-tree-auto/src/Root.svelte' ;
78 import ClientSwitcher from ' ./ClientSwitcher.svelte' ;
89 import Move from ' ./Move.svelte' ;
2526 let { playerID, moves, events } = client;
2627 let ctx = {};
2728 let G = {};
28- client .subscribe ((state ) => {
29+ const unsubscribe = client .subscribe ((state ) => {
2930 if (state) ({ G , ctx } = state);
3031 ({ playerID, moves, events } = client);
3132 });
33+
34+ onDestroy (unsubscribe);
3235 </script >
3336
3437<style >
You can’t perform that action at this time.
0 commit comments