tldraw/www/pages/k/[id].tsx
Steve Ruiz be2c6d6d1f
[refactor] events (#230)
* 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
2021-11-08 14:21:37 +00:00

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,
},
}
}