File tree Expand file tree Collapse file tree 3 files changed +7
-6
lines changed
Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 11import React from "react"
2- import ReactDOM from "react-dom"
2+ import { createRoot } from "react-dom/client "
33import "./index.css"
44import App from "./App"
55import reportWebVitals from "./reportWebVitals"
66
7- ReactDOM . render (
7+ const container = document . getElementById ( "root" )
8+ const root = createRoot ( container ! ) // createRoot(container!) if you use TypeScript
9+ root . render (
810 < React . StrictMode >
911 < App />
1012 </ React . StrictMode > ,
11- document . getElementById ( "root" ) ,
1213)
1314
1415// If you want to start measuring performance in your app, pass a function
Original file line number Diff line number Diff line change @@ -8,8 +8,8 @@ const Lol = () => {
88 // console.log(app)
99 // const a = app.get("a")
1010 // console.log(a)
11- // const [b, bErr] = useContainer().b
12- // console.log("v ", b, bErr)
11+ const [ b , bErr ] = useContainer ( ) . b
12+ console . log ( "render " , b , bErr )
1313 return < p > 123</ p >
1414}
1515
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ export const app = makeRoot()
1313 a : ( ) => new A ( ) ,
1414 } ) )
1515 . add ( ( ctx ) => ( {
16- b : ( ) => new B ( ctx . a ) ,
16+ b : async ( ) => new B ( ctx . a ) ,
1717 } ) )
1818 . add ( ( ctx ) => ( {
1919 c : ( ) => new C ( ctx . a , ctx . b ) ,
You can’t perform that action at this time.
0 commit comments