beginnings: rendering text to message
This commit is contained in:
62
src/reconciler.ts
Normal file
62
src/reconciler.ts
Normal file
@@ -0,0 +1,62 @@
|
||||
import ReactReconciler from "react-reconciler"
|
||||
import type { ReacordContainer } from "./container.js"
|
||||
import { ReacordInstance } from "./instance.js"
|
||||
|
||||
export const reconciler = ReactReconciler<
|
||||
unknown,
|
||||
Record<string, unknown>,
|
||||
ReacordContainer,
|
||||
ReacordInstance,
|
||||
ReacordInstance,
|
||||
unknown,
|
||||
unknown,
|
||||
unknown,
|
||||
unknown,
|
||||
unknown,
|
||||
unknown,
|
||||
unknown,
|
||||
unknown
|
||||
>({
|
||||
now: Date.now,
|
||||
supportsMutation: true,
|
||||
isPrimaryRenderer: true,
|
||||
noTimeout: -1,
|
||||
supportsHydration: false,
|
||||
supportsPersistence: false,
|
||||
|
||||
getRootHostContext: () => ({}),
|
||||
getChildHostContext: () => ({}),
|
||||
shouldSetTextContent: () => false,
|
||||
|
||||
createInstance: (
|
||||
type,
|
||||
props,
|
||||
rootContainerInstance,
|
||||
hostContext,
|
||||
internalInstanceHandle,
|
||||
) => {
|
||||
throw new Error("Not implemented")
|
||||
},
|
||||
|
||||
createTextInstance: (
|
||||
text,
|
||||
rootContainerInstance,
|
||||
hostContext,
|
||||
internalInstanceHandle,
|
||||
) => {
|
||||
return new ReacordInstance(text)
|
||||
},
|
||||
|
||||
prepareForCommit: () => null,
|
||||
resetAfterCommit: () => null,
|
||||
|
||||
clearContainer: (container) => {
|
||||
container.clear()
|
||||
},
|
||||
appendChildToContainer: (container, child) => {
|
||||
container.add(child)
|
||||
},
|
||||
removeChildFromContainer: (container, child) => {
|
||||
container.remove(child)
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user