Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove support for React 17 #264

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,6 @@ module.exports = {
sourceType: "module",
},
rules: {
"no-restricted-imports": [
"error",
{
paths: [
{
name: "react",
importNames: ["useId"],
message:
"'useId' is only available in React 18. Please use the ponyfill from 'utils/useId' instead.",
},
],
},
],
"prettier/prettier": "error",
},
plugins: ["prettier", "react", "@typescript-eslint", "matrix-org"],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
"@fontsource/inter": "^5",
"@types/react": "*",
"@vector-im/compound-design-tokens": ">=1.6.1 <2.0.0",
"react": "^17 || ^18"
"react": "^18"
},
"peerDependenciesMeta": {
"@types/react": {
Expand Down
3 changes: 1 addition & 2 deletions src/components/Form/Controls/Action/Action.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,10 @@ limitations under the License.
*/

import classnames from "classnames";
import React, { forwardRef, ComponentRef, ComponentProps } from "react";
import React, { forwardRef, ComponentRef, ComponentProps, useId } from "react";
import styles from "./Action.module.css";
import { TextInput } from "../Text";

import useId from "../../../../utils/useId";
import { Control } from "@radix-ui/react-form";
import { Tooltip } from "../../../Tooltip/Tooltip";

Expand Down
8 changes: 6 additions & 2 deletions src/components/Menu/FloatingMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ limitations under the License.
*/

import classnames from "classnames";
import React, { ComponentPropsWithoutRef, ReactNode, forwardRef } from "react";
import React, {
ComponentPropsWithoutRef,
ReactNode,
forwardRef,
useId,
} from "react";
import styles from "./FloatingMenu.module.css";
import useId from "../../utils/useId";
import { Text } from "../Typography/Text";

interface TitleProps {
Expand Down
3 changes: 1 addition & 2 deletions src/components/Menu/ToggleMenuItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,9 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import React, { ComponentProps, forwardRef, useCallback } from "react";
import React, { ComponentProps, forwardRef, useCallback, useId } from "react";
import { MenuItem } from "./MenuItem";
import { ToggleInput } from "../Form/Controls/Toggle";
import useId from "../../utils/useId";

type Props = Pick<
ComponentProps<typeof MenuItem>,
Expand Down
3 changes: 1 addition & 2 deletions src/components/Progress/Progress.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,12 @@ See the License for the specific language governing permissions and
limitations under the License.
*/

import React, { forwardRef } from "react";
import React, { forwardRef, useId } from "react";
import classNames from "classnames";

import styles from "./Progress.module.css";

import { Root, Indicator } from "@radix-ui/react-progress";
import useId from "../../utils/useId";

type ProgressProps = {
/** The size variant of the progress bar */
Expand Down
3 changes: 1 addition & 2 deletions src/components/Search/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,11 @@ limitations under the License.
*/

import classnames from "classnames";
import React, { ComponentProps, forwardRef } from "react";
import React, { ComponentProps, forwardRef, useId } from "react";
import styles from "./Search.module.css";
import { Field, Label } from "../Form";

import SearchIcon from "@vector-im/compound-design-tokens/assets/web/icons/search";
import useId from "../../utils/useId";

type SearchProps = {
/**
Expand Down
36 changes: 0 additions & 36 deletions src/utils/useId.ts

This file was deleted.

Loading