Use react18 in playground
This commit is contained in:
parent
f562d225c6
commit
5387fda517
22 changed files with 47 additions and 46 deletions
|
@ -23,13 +23,18 @@
|
||||||
*/
|
*/
|
||||||
module.exports = {
|
module.exports = {
|
||||||
root: true,
|
root: true,
|
||||||
plugins: ['unused-imports', 'eslint-plugin-tsdoc', 'import'],
|
plugins: ['unused-imports', 'eslint-plugin-tsdoc', 'import', 'react'],
|
||||||
settings: {},
|
settings: {
|
||||||
|
react: {
|
||||||
|
version: '18.2',
|
||||||
|
},
|
||||||
|
},
|
||||||
extends: [],
|
extends: [],
|
||||||
rules: {
|
rules: {
|
||||||
'unused-imports/no-unused-imports': 'warn',
|
'unused-imports/no-unused-imports': 'warn',
|
||||||
'tsdoc/syntax': 'warn',
|
'tsdoc/syntax': 'warn',
|
||||||
'no-debugger': 'error',
|
'no-debugger': 'error',
|
||||||
|
'react/no-deprecated': 'error',
|
||||||
|
|
||||||
'no-restricted-imports': [
|
'no-restricted-imports': [
|
||||||
'error',
|
'error',
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import ReactDOM from 'react-dom'
|
import ReactDOM from 'react-dom/client'
|
||||||
import studio from '@theatre/studio'
|
import studio from '@theatre/studio'
|
||||||
import {getProject} from '@theatre/core'
|
import {getProject} from '@theatre/core'
|
||||||
import {Scene} from './Scene'
|
import {Scene} from './Scene'
|
||||||
|
|
||||||
studio.initialize()
|
studio.initialize()
|
||||||
|
|
||||||
ReactDOM.render(
|
ReactDOM.createRoot(document.getElementById('root')!).render(
|
||||||
<Scene project={getProject('Sample project')} />,
|
<Scene project={getProject('Sample project')} />,
|
||||||
document.getElementById('root'),
|
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import {PlaygroundPage} from './home/PlaygroundPage'
|
import {PlaygroundPage} from './home/PlaygroundPage'
|
||||||
import ReactDom from 'react-dom'
|
import ReactDom from 'react-dom/client'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
|
||||||
// like [{'./shared/hello/index.html': () => import('./shared/hello/index.html')}]
|
// like [{'./shared/hello/index.html': () => import('./shared/hello/index.html')}]
|
||||||
|
@ -16,7 +16,6 @@ const groups = (Object.keys(modules) as string[]).reduce((acc, path) => {
|
||||||
return acc
|
return acc
|
||||||
}, {} as {[groupName: string]: string[]})
|
}, {} as {[groupName: string]: string[]})
|
||||||
|
|
||||||
ReactDom.render(
|
ReactDom.createRoot(document.getElementById('root')!).render(
|
||||||
<PlaygroundPage groups={groups} />,
|
<PlaygroundPage groups={groups} />,
|
||||||
document.getElementById('root'),
|
|
||||||
)
|
)
|
||||||
|
|
|
@ -7,4 +7,4 @@ import extension from '@theatre/r3f/dist/extension'
|
||||||
studio.extend(extension)
|
studio.extend(extension)
|
||||||
studio.initialize()
|
studio.initialize()
|
||||||
|
|
||||||
ReactDOM.createRoot(document.getElementById('root')).render(<App />)
|
ReactDOM.createRoot(document.getElementById('root')!).render(<App />)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import ReactDOM from 'react-dom'
|
import ReactDOM from 'react-dom/client'
|
||||||
import App from './App'
|
import App from './App'
|
||||||
import studio from '@theatre/studio'
|
import studio from '@theatre/studio'
|
||||||
import extension from '@theatre/r3f/dist/extension'
|
import extension from '@theatre/r3f/dist/extension'
|
||||||
|
@ -7,4 +7,4 @@ import extension from '@theatre/r3f/dist/extension'
|
||||||
studio.extend(extension)
|
studio.extend(extension)
|
||||||
studio.initialize()
|
studio.initialize()
|
||||||
|
|
||||||
ReactDOM.render(<App />, document.getElementById('root'))
|
ReactDOM.createRoot(document.getElementById('root')!).render(<App />)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import ReactDOM from 'react-dom'
|
import ReactDOM from 'react-dom/client'
|
||||||
import App from './App'
|
import App from './App'
|
||||||
import studio from '@theatre/studio'
|
import studio from '@theatre/studio'
|
||||||
import extension from '@theatre/r3f/dist/extension'
|
import extension from '@theatre/r3f/dist/extension'
|
||||||
|
@ -15,4 +15,6 @@ studio.initialize({
|
||||||
__experimental_rafDriver: rafDriver,
|
__experimental_rafDriver: rafDriver,
|
||||||
})
|
})
|
||||||
|
|
||||||
ReactDOM.render(<App rafDriver={rafDriver} />, document.getElementById('root'))
|
ReactDOM.createRoot(document.getElementById('root')!).render(
|
||||||
|
<App rafDriver={rafDriver} />,
|
||||||
|
)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import ReactDOM from 'react-dom'
|
import ReactDOM from 'react-dom/client'
|
||||||
import studio from '@theatre/studio'
|
import studio from '@theatre/studio'
|
||||||
import {getProject} from '@theatre/core'
|
import {getProject} from '@theatre/core'
|
||||||
import {Scene} from './Scene'
|
import {Scene} from './Scene'
|
||||||
|
@ -9,7 +9,6 @@ import {Scene} from './Scene'
|
||||||
|
|
||||||
studio.initialize()
|
studio.initialize()
|
||||||
|
|
||||||
ReactDOM.render(
|
ReactDOM.createRoot(document.getElementById('root')!).render(
|
||||||
<Scene project={getProject('Sample project')} />,
|
<Scene project={getProject('Sample project')} />,
|
||||||
document.getElementById('root'),
|
|
||||||
)
|
)
|
||||||
|
|
|
@ -12,7 +12,7 @@ import {Scene} from './Scene'
|
||||||
|
|
||||||
studio.initialize()
|
studio.initialize()
|
||||||
|
|
||||||
ReactDOM.createRoot(document.getElementById('root')).render(
|
ReactDOM.createRoot(document.getElementById('root')!).render(
|
||||||
<Scene
|
<Scene
|
||||||
project={getProject('Sample project', {
|
project={getProject('Sample project', {
|
||||||
// experiments: {
|
// experiments: {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import ReactDOM from 'react-dom'
|
import ReactDOM from 'react-dom/client'
|
||||||
import App from './App'
|
import App from './App'
|
||||||
import type {ToolsetConfig} from '@theatre/studio'
|
import type {ToolsetConfig} from '@theatre/studio'
|
||||||
import studio from '@theatre/studio'
|
import studio from '@theatre/studio'
|
||||||
|
@ -70,4 +70,4 @@ studio.extend({
|
||||||
})
|
})
|
||||||
studio.initialize()
|
studio.initialize()
|
||||||
|
|
||||||
ReactDOM.render(<App />, document.getElementById('root'))
|
ReactDOM.createRoot(document.getElementById('root')!).render(<App />)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import ReactDOM from 'react-dom'
|
import ReactDOM from 'react-dom/client'
|
||||||
import App from './App'
|
import App from './App'
|
||||||
import type {ISheetObject} from '@theatre/core'
|
import type {ISheetObject} from '@theatre/core'
|
||||||
import {onChange, types, val} from '@theatre/core'
|
import {onChange, types, val} from '@theatre/core'
|
||||||
|
@ -60,4 +60,4 @@ studio.extend({
|
||||||
})
|
})
|
||||||
studio.initialize()
|
studio.initialize()
|
||||||
|
|
||||||
ReactDOM.render(<App />, document.getElementById('root'))
|
ReactDOM.createRoot(document.getElementById('root')!).render(<App />)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import ReactDOM from 'react-dom'
|
import ReactDOM from 'react-dom/client'
|
||||||
import App from './App'
|
import App from './App'
|
||||||
import studio from '@theatre/studio'
|
import studio from '@theatre/studio'
|
||||||
import extension from '@theatre/r3f/dist/extension'
|
import extension from '@theatre/r3f/dist/extension'
|
||||||
|
@ -92,4 +92,4 @@ studio.extend({
|
||||||
})
|
})
|
||||||
studio.initialize()
|
studio.initialize()
|
||||||
|
|
||||||
ReactDOM.render(<App />, document.getElementById('root'))
|
ReactDOM.createRoot(document.getElementById('root')!).render(<App />)
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
import {getProject, types} from '@theatre/core'
|
import {getProject, types} from '@theatre/core'
|
||||||
import studio from '@theatre/studio'
|
import studio from '@theatre/studio'
|
||||||
import React, {useEffect, useState} from 'react'
|
import React, {useEffect, useState} from 'react'
|
||||||
import {render} from 'react-dom'
|
import {render} from 'react-dom/client'
|
||||||
import styled from 'styled-components'
|
import styled from 'styled-components'
|
||||||
|
|
||||||
const project = getProject('Image type playground', {
|
const project = getProject('Image type playground', {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import ReactDOM from 'react-dom'
|
import ReactDOM from 'react-dom/client'
|
||||||
import App from './App'
|
import App from './App'
|
||||||
import studio from '@theatre/studio'
|
import studio from '@theatre/studio'
|
||||||
import extension from '@theatre/r3f/dist/extension'
|
import extension from '@theatre/r3f/dist/extension'
|
||||||
|
@ -7,9 +7,8 @@ import extension from '@theatre/r3f/dist/extension'
|
||||||
studio.extend(extension)
|
studio.extend(extension)
|
||||||
studio.initialize()
|
studio.initialize()
|
||||||
|
|
||||||
ReactDOM.render(
|
ReactDOM.createRoot(document.getElementById('root')!).render(
|
||||||
<React.StrictMode>
|
<React.StrictMode>
|
||||||
<App />
|
<App />
|
||||||
</React.StrictMode>,
|
</React.StrictMode>,
|
||||||
document.getElementById('root'),
|
|
||||||
)
|
)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import ReactDOM from 'react-dom'
|
import ReactDOM from 'react-dom/client'
|
||||||
import studio from '@theatre/studio'
|
import studio from '@theatre/studio'
|
||||||
import {getProject, notify} from '@theatre/core'
|
import {getProject, notify} from '@theatre/core'
|
||||||
import {Scene} from './Scene'
|
import {Scene} from './Scene'
|
||||||
|
@ -24,7 +24,7 @@ void getProject('Sample project').ready.then(() => {
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
ReactDOM.render(
|
ReactDOM.createRoot(document.getElementById('root')!).render(
|
||||||
<Scene
|
<Scene
|
||||||
project={getProject('Sample project', {
|
project={getProject('Sample project', {
|
||||||
// experiments: {
|
// experiments: {
|
||||||
|
@ -36,5 +36,4 @@ ReactDOM.render(
|
||||||
// },
|
// },
|
||||||
})}
|
})}
|
||||||
/>,
|
/>,
|
||||||
document.getElementById('root'),
|
|
||||||
)
|
)
|
||||||
|
|
|
@ -7,4 +7,4 @@ import extension from '@theatre/r3f/dist/extension'
|
||||||
studio.extend(extension)
|
studio.extend(extension)
|
||||||
studio.initialize()
|
studio.initialize()
|
||||||
|
|
||||||
ReactDOM.createRoot(document.getElementById('root')).render(<App />)
|
ReactDOM.createRoot(document.getElementById('root')!).render(<App />)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import ReactDOM from 'react-dom'
|
import ReactDOM from 'react-dom/client'
|
||||||
import studio from '@theatre/studio'
|
import studio from '@theatre/studio'
|
||||||
import {getProject} from '@theatre/core'
|
import {getProject} from '@theatre/core'
|
||||||
import {Scene} from './Scene'
|
import {Scene} from './Scene'
|
||||||
|
@ -9,4 +9,4 @@ const project = getProject('Sample project')
|
||||||
studio.initialize()
|
studio.initialize()
|
||||||
RemoteController(project)
|
RemoteController(project)
|
||||||
|
|
||||||
ReactDOM.render(<Scene />, document.getElementById('root'))
|
ReactDOM.createRoot(document.getElementById('root')!).render(<Scene />)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import {button, initialize, types, useControls} from 'theatric'
|
import {button, initialize, types, useControls} from 'theatric'
|
||||||
import {render} from 'react-dom'
|
import {render} from 'react-dom/client'
|
||||||
import React, {useState} from 'react'
|
import React, {useState} from 'react'
|
||||||
import state from './state.json'
|
import state from './state.json'
|
||||||
|
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import ReactDOM from 'react-dom'
|
import ReactDOM from 'react-dom/client'
|
||||||
import studio from '@theatre/studio'
|
import studio from '@theatre/studio'
|
||||||
import {getProject} from '@theatre/core'
|
import {getProject} from '@theatre/core'
|
||||||
import ThreeScene from './ThreeScene'
|
import ThreeScene from './ThreeScene'
|
||||||
|
|
||||||
studio.initialize()
|
studio.initialize()
|
||||||
|
|
||||||
ReactDOM.render(
|
ReactDOM.createRoot(document.getElementById('root')!).render(
|
||||||
<ThreeScene project={getProject('Three Basic')} />,
|
<ThreeScene project={getProject('Three Basic')} />,
|
||||||
document.getElementById('root'),
|
|
||||||
)
|
)
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
* can be tweaked and animated.
|
* can be tweaked and animated.
|
||||||
*/
|
*/
|
||||||
import React, {useMemo, useState} from 'react'
|
import React, {useMemo, useState} from 'react'
|
||||||
import {render} from 'react-dom'
|
import {render} from 'react-dom/client'
|
||||||
import {getProject} from '@theatre/core'
|
import {getProject} from '@theatre/core'
|
||||||
import type {ITurtle} from './turtle'
|
import type {ITurtle} from './turtle'
|
||||||
import TurtleRenderer from './TurtleRenderer'
|
import TurtleRenderer from './TurtleRenderer'
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import ReactDOM from 'react-dom'
|
import ReactDOM from 'react-dom/client'
|
||||||
import App from './App'
|
import App from './App'
|
||||||
import studio from '@theatre/studio'
|
import studio from '@theatre/studio'
|
||||||
import extension from '@theatre/r3f/dist/extension'
|
import extension from '@theatre/r3f/dist/extension'
|
||||||
|
@ -7,4 +7,4 @@ import extension from '@theatre/r3f/dist/extension'
|
||||||
studio.extend(extension)
|
studio.extend(extension)
|
||||||
studio.initialize({usePersistentStorage: false})
|
studio.initialize({usePersistentStorage: false})
|
||||||
|
|
||||||
ReactDOM.render(<App />, document.getElementById('root'))
|
ReactDOM.createRoot(document.getElementById('root')!).render(<App />)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
import ReactDOM from 'react-dom'
|
import ReactDOM from 'react-dom/client'
|
||||||
import App from './App'
|
import App from './App'
|
||||||
import studio from '@theatre/studio'
|
import studio from '@theatre/studio'
|
||||||
import extension from '@theatre/r3f/dist/extension'
|
import extension from '@theatre/r3f/dist/extension'
|
||||||
|
@ -10,7 +10,7 @@ const studioPrivate = getStudio()
|
||||||
studio.extend(extension)
|
studio.extend(extension)
|
||||||
studio.initialize()
|
studio.initialize()
|
||||||
|
|
||||||
ReactDOM.render(<App />, document.getElementById('root'))
|
ReactDOM.createRoot(document.getElementById('root')!).render(<App />)
|
||||||
|
|
||||||
const raf = studioPrivate.ticker
|
const raf = studioPrivate.ticker
|
||||||
|
|
||||||
|
|
|
@ -146,11 +146,11 @@ const r3fExtension: IExtension = {
|
||||||
{
|
{
|
||||||
class: 'snapshot',
|
class: 'snapshot',
|
||||||
mount: ({paneId, node}) => {
|
mount: ({paneId, node}) => {
|
||||||
ReactDOM.createRoot(node).render(
|
const root = ReactDOM.createRoot(node)
|
||||||
React.createElement(SnapshotEditor, {paneId}),
|
|
||||||
)
|
root.render(React.createElement(SnapshotEditor, {paneId}))
|
||||||
function unmount() {
|
function unmount() {
|
||||||
ReactDOM.unmountComponentAtNode(node)
|
root.unmount()
|
||||||
}
|
}
|
||||||
return unmount
|
return unmount
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue