Skip to content

Commit

Permalink
create the apps react 18 style
Browse files Browse the repository at this point in the history
  • Loading branch information
signed committed Jan 14, 2023
1 parent 2b5b5a5 commit e7f5cc0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
14 changes: 9 additions & 5 deletions src/Gallery.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import * as React from 'react'
import * as ReactDOM from 'react-dom'
import { NoProps, NoState } from 'lang/react'
import { BattleGoal, officialBattleGoals, satireGamingBattleGoals } from 'battlegoals/battleGoals'
import BattleGoalCard from 'battlegoals/BattleGoalCard'
import { BattleGoal, officialBattleGoals, satireGamingBattleGoals } from 'battlegoals/battleGoals'
import { NoProps, NoState } from 'lang/react'
import * as React from 'react'
import { CSSProperties } from 'react'
import { createRoot } from 'react-dom/client'
import './style.css'

interface ScanFilenameLookupTable {
Expand Down Expand Up @@ -75,4 +75,8 @@ class Gallery extends React.Component<NoProps, NoState> {
}
}

ReactDOM.render(<Gallery />, document.getElementById('root'))
const container = document.getElementById('root')
if (container === null) {
throw new Error('root element not found')
}
createRoot(container).render(<Gallery />)
11 changes: 7 additions & 4 deletions src/StagingRoom.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import * as React from 'react'
import * as ReactDOM from 'react-dom'
import { PartyBattleGoals } from 'battlegoals/PartyBattleGoals'
import * as React from 'react'
import { createRoot } from 'react-dom/client'
import './style.css'

let app = <PartyBattleGoals />
ReactDOM.render(app, document.getElementById('root'))
const container = document.getElementById('root')
if (container === null) {
throw new Error('root element not found')
}
createRoot(container).render(<PartyBattleGoals />)
4 changes: 1 addition & 3 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@ import { createRoot } from 'react-dom/client'
import './style.css'

const initialCardStacks = App.initializeStacksFromLocalStorage()
const app = <App initialCardStacks={initialCardStacks} />

const container = document.getElementById('root')
if (container === null) {
throw new Error('root element not found')
}
createRoot(container).render(app)
createRoot(container).render(<App initialCardStacks={initialCardStacks} />)

0 comments on commit e7f5cc0

Please sign in to comment.