be2c6d6d1f
* bumps rko, adds events * rename tlstate to state, fix env for multiplayer test * Fix multiplayer * rename data tldrawstate to tldrawsnapshot * Update multiplayer-editor.tsx * Fix shhhmp * Update 2.tldr * Add API to the README
30 lines
636 B
TypeScript
30 lines
636 B
TypeScript
import * as React from 'react'
|
|
import type { GetServerSideProps } from 'next'
|
|
import Head from 'next/head'
|
|
import dynamic from 'next/dynamic'
|
|
const MultiplayerEditor = dynamic(() => import('components/multiplayer-editor'), { ssr: false })
|
|
|
|
interface RoomProps {
|
|
id: string
|
|
}
|
|
|
|
export default function Room({ id }: RoomProps): JSX.Element {
|
|
return (
|
|
<>
|
|
<Head>
|
|
<title>tldraw</title>
|
|
</Head>
|
|
<MultiplayerEditor roomId={id} />
|
|
</>
|
|
)
|
|
}
|
|
|
|
export const getServerSideProps: GetServerSideProps = async (context) => {
|
|
const id = context.query.id?.toString()
|
|
|
|
return {
|
|
props: {
|
|
id,
|
|
},
|
|
}
|
|
}
|