Skip to content

Commit

Permalink
fix: Excalidraw named export type (#5078)
Browse files Browse the repository at this point in the history
  • Loading branch information
dwelle committed Apr 22, 2022
1 parent a66cfe2 commit 9423ac3
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
3 changes: 2 additions & 1 deletion src/excalidraw-app/index.tsx
Expand Up @@ -19,7 +19,8 @@ import {
} from "../element/types";
import { useCallbackRefState } from "../hooks/useCallbackRefState";
import { Language, t } from "../i18n";
import Excalidraw, {
import {
Excalidraw,
defaultLang,
languages,
} from "../packages/excalidraw/index";
Expand Down
3 changes: 0 additions & 3 deletions src/packages/excalidraw/entry.js
@@ -1,6 +1,3 @@
import Excalidraw from "./index";

import "../../../public/fonts.css";

export { Excalidraw };
export * from "./index";
8 changes: 5 additions & 3 deletions src/packages/excalidraw/index.tsx
Expand Up @@ -13,7 +13,7 @@ import { DEFAULT_UI_OPTIONS } from "../../constants";
import { Provider } from "jotai";
import { jotaiScope, jotaiStore } from "../../jotai";

const Excalidraw = (props: ExcalidrawProps) => {
const ExcalidrawBase = (props: ExcalidrawProps) => {
const {
onChange,
initialData,
Expand Down Expand Up @@ -173,8 +173,10 @@ const areEqual = (
const forwardedRefComp = forwardRef<
ExcalidrawAPIRefValue,
PublicExcalidrawProps
>((props, ref) => <Excalidraw {...props} excalidrawRef={ref} />);
export default React.memo(forwardedRefComp, areEqual);
>((props, ref) => <ExcalidrawBase {...props} excalidrawRef={ref} />);

export const Excalidraw = React.memo(forwardedRefComp, areEqual);

export {
getSceneVersion,
isInvisiblySmallElement,
Expand Down
2 changes: 1 addition & 1 deletion src/tests/packages/excalidraw.test.tsx
@@ -1,5 +1,5 @@
import { fireEvent, GlobalTestState, render } from "../test-utils";
import Excalidraw from "../../packages/excalidraw/index";
import { Excalidraw } from "../../packages/excalidraw/index";
import { queryByText, queryByTestId } from "@testing-library/react";
import { GRID_SIZE, THEME } from "../../constants";
import { t } from "../../i18n";
Expand Down
2 changes: 1 addition & 1 deletion src/tests/scroll.test.tsx
Expand Up @@ -4,7 +4,7 @@ import {
restoreOriginalGetBoundingClientRect,
waitFor,
} from "./test-utils";
import Excalidraw from "../packages/excalidraw/index";
import { Excalidraw } from "../packages/excalidraw/index";
import { API } from "./helpers/api";

const { h } = window;
Expand Down

2 comments on commit 9423ac3

@vercel
Copy link

@vercel vercel bot commented on 9423ac3 Apr 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 9423ac3 Apr 22, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

excalidraw-package-example – ./src/packages/excalidraw

excalidraw-package-example-git-master-excalidraw.vercel.app
excalidraw-package-example-excalidraw.vercel.app
excalidraw-package-example.vercel.app

Please sign in to comment.