Skip to content

Commit

Permalink
ignore
Browse files Browse the repository at this point in the history
  • Loading branch information
johnpanos committed Aug 1, 2024
1 parent ec24292 commit 2204937
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/components/Select/Select.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// @ts-ignore
import React, { useState, useRef, useEffect } from 'react';
import ReactSelect, {
components as ReactSelectComponents,
Expand Down Expand Up @@ -59,8 +58,10 @@ const Select: React.FC<SelectProps> = ({
action: ActionMeta<Option>
) => {
if (!isControlled) {
// @ts-ignore
setInternalValue(newValue);
}
// @ts-ignore
onChange?.(newValue, action);
};

Expand All @@ -75,14 +76,13 @@ const Select: React.FC<SelectProps> = ({
loadOptions ? 'select-async' : ''
} ${className || ''}`.trim();

const CustomValueContainer = ({ children, ...props }: ValueContainerProps<Option, boolean>) => {
return (
// eslint-disable-next-line no-shadow,react/no-unstable-nested-components
const CustomValueContainer = ({ children, ...props }: ValueContainerProps<Option, boolean>) => (
<ReactSelectComponents.ValueContainer {...props}>
{children}
{name && <input type="hidden" name={name} value={props.getValue()[0]?.value || ''} />}
</ReactSelectComponents.ValueContainer>
);
};

return (
<SelectComponent
Expand All @@ -97,6 +97,7 @@ const Select: React.FC<SelectProps> = ({
{...props}
components={{
...ReactSelectComponents,
// eslint-disable-next-line react/no-unstable-nested-components
Input: (inputComponentProps: any) => (
<ReactSelectComponents.Input
{...inputComponentProps}
Expand All @@ -110,9 +111,4 @@ const Select: React.FC<SelectProps> = ({
);
};

// For testing purposes
Select.Async = AsyncSelect;
Select.AsyncCreatable = AsyncCreatableSelect;
Select.Creatable = CreatableSelect;

export default Select;

0 comments on commit 2204937

Please sign in to comment.