diff --git a/Accordion.d.ts b/Accordion.d.ts index da4b2ee..1a8e81f 100644 --- a/Accordion.d.ts +++ b/Accordion.d.ts @@ -2,40 +2,40 @@ import * as React from 'react'; import { StyleProp, ViewStyle } from 'react-native'; import { EasingMode } from './index'; -export interface AccordionProps { +export interface AccordionProps { /** * An array of sections passed to the render methods */ - sections: any[]; + sections: T[]; /** * A function that should return a renderable representing the header */ renderHeader( - content: any, + content: T, index: number, isActive: boolean, - sections: any[] + sections: T[] ): React.ReactElement<{}>; /** * A function that should return a renderable representing the section title above the touchable */ renderSectionTitle?( - content: any, + content: T, index: number, isActive: boolean, - sections: any[] + sections: T[] ): React.ReactElement<{}>; /** * A function that should return a renderable representing the content */ renderContent( - content: any, + content: T, index: number, isActive: boolean, - sections: any[] + sections: T[] ): React.ReactElement<{}>; /** @@ -108,4 +108,4 @@ export interface AccordionProps { sectionContainerStyle?: StyleProp; } -export default class Accordion extends React.Component {} +export default class Accordion extends React.Component> {} diff --git a/Accordion.js b/Accordion.js index 30a523d..761dc9e 100644 --- a/Accordion.js +++ b/Accordion.js @@ -57,12 +57,6 @@ export default class Accordion extends Component { } } - handleErrors = () => { - if (!Array.isArray(this.props.sections)) { - throw new Error('Sections should be an array'); - } - }; - render() { let viewProps = {}; let collapsibleProps = {}; @@ -75,8 +69,6 @@ export default class Accordion extends Component { } }); - this.handleErrors(); - const { activeSections, sectionContainerStyle, diff --git a/package.json b/package.json index d56daf5..1677f28 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-collapsible", - "version": "1.2.1", + "version": "1.3.0", "description": "Animated collapsible component for React Native using the Animated API. Good for accordions, toggles etc", "main": "Collapsible.js", "types": "index.d.ts",