feat: support excalidrawAPI and remove refs support (#7251)

* feat: support excalidrawAPI and remove refs support

* update changelog

* remove ready and readyPromise

* update changelog

* update changelog
This commit is contained in:
Aakansha Doshi
2023-11-10 15:33:43 +05:30
committed by GitHub
parent 864c0b3ea8
commit cee00767df
8 changed files with 32 additions and 47 deletions

View File

@ -15,7 +15,9 @@ describe("event callbacks", () => {
beforeEach(async () => {
const excalidrawAPIPromise = resolvablePromise<ExcalidrawImperativeAPI>();
await render(
<Excalidraw ref={(api) => excalidrawAPIPromise.resolve(api as any)} />,
<Excalidraw
excalidrawAPI={(api) => excalidrawAPIPromise.resolve(api as any)}
/>,
);
excalidrawAPI = await excalidrawAPIPromise;
});

View File

@ -14,7 +14,9 @@ describe("setActiveTool()", () => {
beforeEach(async () => {
const excalidrawAPIPromise = resolvablePromise<ExcalidrawImperativeAPI>();
await render(
<Excalidraw ref={(api) => excalidrawAPIPromise.resolve(api as any)} />,
<Excalidraw
excalidrawAPI={(api) => excalidrawAPIPromise.resolve(api as any)}
/>,
);
excalidrawAPI = await excalidrawAPIPromise;
});