fix missed update issue
This commit is contained in:
@@ -39,7 +39,7 @@ export const reconciler = ReactReconciler<
|
|||||||
never, // HydratableInstance,
|
never, // HydratableInstance,
|
||||||
never, // PublicInstance,
|
never, // PublicInstance,
|
||||||
null, // HostContext,
|
null, // HostContext,
|
||||||
never, // UpdatePayload,
|
[], // UpdatePayload,
|
||||||
BaseInstance[], // ChildSet,
|
BaseInstance[], // ChildSet,
|
||||||
unknown, // TimeoutHandle,
|
unknown, // TimeoutHandle,
|
||||||
unknown // NoTimeout
|
unknown // NoTimeout
|
||||||
@@ -100,10 +100,15 @@ export const reconciler = ReactReconciler<
|
|||||||
newProps: Props,
|
newProps: Props,
|
||||||
) => createInstance(type, newProps),
|
) => createInstance(type, newProps),
|
||||||
|
|
||||||
|
// returning a non-null value tells react to re-render the whole thing
|
||||||
|
// on any prop change
|
||||||
|
//
|
||||||
|
// we can probably optimize this to actually compare old/new props though
|
||||||
|
prepareUpdate: () => [],
|
||||||
|
|
||||||
finalizeInitialChildren: () => false,
|
finalizeInitialChildren: () => false,
|
||||||
prepareForCommit: (container) => null,
|
prepareForCommit: (container) => null,
|
||||||
resetAfterCommit: () => null,
|
resetAfterCommit: () => null,
|
||||||
prepareUpdate: () => null,
|
|
||||||
getPublicInstance: () => raise("Not implemented"),
|
getPublicInstance: () => raise("Not implemented"),
|
||||||
preparePortalMount: () => raise("Not implemented"),
|
preparePortalMount: () => raise("Not implemented"),
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -60,12 +60,12 @@ test("nested text", async () => {
|
|||||||
await assertMessages([{ content: "hi world hi moon hi sun" }])
|
await assertMessages([{ content: "hi world hi moon hi sun" }])
|
||||||
})
|
})
|
||||||
|
|
||||||
test.only("empty embed fallback", async () => {
|
test("empty embed fallback", async () => {
|
||||||
await root.render(<Embed />)
|
await root.render(<Embed />)
|
||||||
await assertMessages([{ embeds: [{ description: "_ _" }] }])
|
await assertMessages([{ embeds: [{ description: "_ _" }] }])
|
||||||
})
|
})
|
||||||
|
|
||||||
test.only("embed with only author", async () => {
|
test("embed with only author", async () => {
|
||||||
await root.render(<Embed author={{ name: "only author" }} />)
|
await root.render(<Embed author={{ name: "only author" }} />)
|
||||||
await assertMessages([
|
await assertMessages([
|
||||||
{ embeds: [{ description: "_ _", author: { name: "only author" } }] },
|
{ embeds: [{ description: "_ _", author: { name: "only author" } }] },
|
||||||
|
|||||||
Reference in New Issue
Block a user