Skip to content

Commit

Permalink
chore: remove react-is
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinCupela committed Jan 28, 2025
1 parent 09a7de0 commit 20e4c90
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 22 deletions.
2 changes: 0 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@
"react-dropzone": "^14.2.3",
"react-fast-compare": "^3.2.2",
"react-image-gallery": "1.2.12",
"react-is": "^18.1.0",
"react-markdown": "^8.0.7",
"react-player": "2.10.1",
"react-popper": "^2.3.0",
Expand Down Expand Up @@ -205,7 +204,6 @@
"@types/react": "^19.0.7",
"@types/react-dom": "^19.0.3",
"@types/react-image-gallery": "^1.2.4",
"@types/react-is": "^19.0.0",
"@types/textarea-caret": "3.0.0",
"@types/uuid": "^8.3.0",
"@typescript-eslint/eslint-plugin": "5.62.0",
Expand Down
5 changes: 0 additions & 5 deletions src/components/AutoCompleteTextarea/Textarea.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import React from 'react';
import PropTypes from 'prop-types';
import Textarea from 'react-textarea-autosize';
import getCaretCoordinates from 'textarea-caret';
import { isValidElementType } from 'react-is';
import clsx from 'clsx';

import { List as DefaultSuggestionList } from './List';
Expand Down Expand Up @@ -362,10 +361,6 @@ export class ReactTextareaAutocomplete extends React.Component {
throw new Error('Trigger provider has to provide an array!');
}

if (!isValidElementType(component)) {
throw new Error('Component should be defined!');
}

// throw away if we resolved old trigger
if (currentTrigger !== this.state.currentTrigger) return;

Expand Down
8 changes: 1 addition & 7 deletions src/components/AutoCompleteTextarea/utils.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { isValidElementType } from 'react-is';

export const DEFAULT_CARET_POSITION = 'next';

export function defaultScrollToItem(container, item) {
Expand Down Expand Up @@ -42,11 +40,7 @@ export const triggerPropsCheck = ({ trigger }) => {
// $FlowFixMe
const triggerSetting = settings;

const { callback, component, dataProvider, output } = triggerSetting;

if (!isValidElementType(component)) {
return Error('Invalid prop trigger: component should be defined.');
}
const { callback, dataProvider, output } = triggerSetting;

if (!dataProvider || typeof dataProvider !== 'function') {
return Error('Invalid prop trigger: dataProvider should be defined.');
Expand Down
9 changes: 1 addition & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2642,13 +2642,6 @@
dependencies:
"@types/react" "*"

"@types/react-is@^19.0.0":
version "19.0.0"
resolved "https://registry.yarnpkg.com/@types/react-is/-/react-is-19.0.0.tgz#eccf45556cf1858e9116eed1f9e7b51496501a7a"
integrity sha512-71dSZeeJ0t3aoPyY9x6i+JNSvg5m9EF2i2OlSZI5QoJuI8Ocgor610i+4A10TQmURR+0vLwcVCEYFpXdzM1Biw==
dependencies:
"@types/react" "*"

"@types/react@*":
version "18.2.55"
resolved "https://registry.yarnpkg.com/@types/react/-/react-18.2.55.tgz#38141821b7084404b5013742bc4ae08e44da7a67"
Expand Down Expand Up @@ -11042,7 +11035,7 @@ react-is@^17.0.1:
resolved "https://registry.yarnpkg.com/react-is/-/react-is-17.0.2.tgz#e691d4a8e9c789365655539ab372762b0efb54f0"
integrity sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==

react-is@^18.0.0, react-is@^18.1.0:
react-is@^18.0.0:
version "18.3.1"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-18.3.1.tgz#e83557dc12eae63a99e003a46388b1dcbb44db7e"
integrity sha512-/LLMVyas0ljjAtoYiPqYiL8VWXzUUdThrmU5+n20DZv+a+ClRoevUzw5JxU+Ieh5/c87ytoTBV9G1FiKfNJdmg==
Expand Down

0 comments on commit 20e4c90

Please sign in to comment.