From 13ae8b88f534e31437d2f202c68dae94a5ceede6 Mon Sep 17 00:00:00 2001 From: Nicola Molinari Date: Sun, 28 Aug 2022 23:01:27 +0200 Subject: [PATCH 1/2] fix(auto-id): remove React 18 check --- packages/auto-id/src/auto-id.ts | 9 --------- 1 file changed, 9 deletions(-) diff --git a/packages/auto-id/src/auto-id.ts b/packages/auto-id/src/auto-id.ts index 8fefcdfd0..c513bec49 100644 --- a/packages/auto-id/src/auto-id.ts +++ b/packages/auto-id/src/auto-id.ts @@ -87,15 +87,6 @@ function useId( function useId(): string | undefined; function useId(providedId?: number | string | undefined | null) { - // TODO: Remove error flag when updating internal deps to React 18. None of - // our tricks will play well with concurrent rendering anyway. - // @ts-expect-error - if (typeof React.useId === "function") { - // @ts-expect-error - let id = React.useId(providedId); - return providedId != null ? providedId : id; - } - // If this instance isn't part of the initial render, we don't have to do the // double render/patch-up dance. We can just generate the ID and return it. let initialId = providedId ?? (serverHandoffComplete ? genId() : null); From a8aed9eb61b4a2514e3f4d839d2e0631311cde41 Mon Sep 17 00:00:00 2001 From: Nicola Molinari Date: Sun, 28 Aug 2022 23:01:52 +0200 Subject: [PATCH 2/2] fix(playground): imports --- .gitignore | 3 +++ playground/stories/window-size/basic.example.js | 2 +- playground/stories/window-size/basic.example.tsx | 2 +- website/src/pages/window-size.mdx | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 1277d176f..8d9e4d668 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,9 @@ node_modules .env coverage +# storybook +/playground/storybook-static + # website /website-deploy-key /website-deploy-key.pub diff --git a/playground/stories/window-size/basic.example.js b/playground/stories/window-size/basic.example.js index 9e26af56f..0cac4f5ea 100644 --- a/playground/stories/window-size/basic.example.js +++ b/playground/stories/window-size/basic.example.js @@ -1,5 +1,5 @@ import * as React from "react"; -import WindowSize from "@reach/window-size"; +import { WindowSize } from "@reach/window-size"; let name = "Basic"; diff --git a/playground/stories/window-size/basic.example.tsx b/playground/stories/window-size/basic.example.tsx index f24f7e12a..2df009ee6 100644 --- a/playground/stories/window-size/basic.example.tsx +++ b/playground/stories/window-size/basic.example.tsx @@ -1,5 +1,5 @@ import * as React from "react"; -import WindowSize from "@reach/window-size"; +import { WindowSize } from "@reach/window-size"; let name = "Basic (TS)"; diff --git a/website/src/pages/window-size.mdx b/website/src/pages/window-size.mdx index 09faa4029..ed998561b 100644 --- a/website/src/pages/window-size.mdx +++ b/website/src/pages/window-size.mdx @@ -28,7 +28,7 @@ yarn add @reach/window-size ``` ```js -import WindowSize, { useWindowSize } from "@reach/window-size"; +import { WindowSize, useWindowSize } from "@reach/window-size"; ``` ## Component API