fix(react-native-collapsible/Accordion): Use any[] type for sections.

This commit is contained in:
Umidbek Karimov
2018-03-16 15:43:01 +05:00
parent 17c3e0a996
commit 8bd7283dc8
2 changed files with 25 additions and 1 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ export interface AccordionProps {
/**
* An array of sections passed to the render methods
*/
sections: string[];
sections: any[];
/**
* A function that should return a renderable representing the header
@@ -36,3 +36,27 @@ class AccordianTest extends React.Component<any, any> {
);
}
}
class AccordionComplexTest extends React.Component<any, any> {
_renderHeader() {
return (
<View />
);
}
_renderContent() {
return (
<View />
);
}
render() {
return (
<Accordion
sections={[{icon: 'foo', title: 'Section 1'}, {icon: 'bar', title: 'Section 2'}, {icon: 'baz', title: 'Section 3'}]}
renderHeader={this._renderHeader}
renderContent={this._renderContent}
/>
);
}
}