Skip to content

Commit

Permalink
Fix type
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusps committed Jun 19, 2020
1 parent 535317b commit 3af4794
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions react/components/AutocompleteInput/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/ban-ts-ignore */
/* eslint-disable @typescript-eslint/no-explicit-any */
import PropTypes from 'prop-types'
import React, { useState, useRef, FC, ReactNode } from 'react'
Expand All @@ -16,7 +17,7 @@ export type AutocompleteInputProps = {
options: {
onSelect: (option: AutocompleteOption) => void
value: any
renderOption?: (renderer: any, index: number) => any
renderOption?: (renderer: any, index: number) => ReactNode
loading?: boolean
lastSearched?: any
icon?: ReactNode
Expand Down Expand Up @@ -119,7 +120,7 @@ const AutocompleteInput: FC<AutocompleteInputProps> = ({
},
})

const renderOptions = (): React.ReactElement | React.ReactElement[] => (
const renderOptions = (): ReactNode => (
<div className="flex flex-column">
{showLastSearched ? (
<div className="pa4 b f6">
Expand Down Expand Up @@ -172,6 +173,7 @@ const AutocompleteInput: FC<AutocompleteInputProps> = ({

AutocompleteInput.propTypes = {
/** Input props. All HTMLInput props can be added too */
// @ts-ignore
input: PropTypes.shape({
/** Clear input handler */
onClear: PropTypes.func.isRequired,
Expand All @@ -185,6 +187,7 @@ AutocompleteInput.propTypes = {
disabled: PropTypes.bool,
}).isRequired,
/** Options props. More details in the examples */
// @ts-ignore
options: PropTypes.shape({
/**
* Determine if a spinner will be shown below the given options
Expand Down

0 comments on commit 3af4794

Please sign in to comment.