mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
Merge pull request #24333 from umidbekkarimov/react-native-collapsible
[react-native-collapsible/Accordion]: Allow to use complex sections
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
+1
@@ -1,6 +1,7 @@
|
||||
// Type definitions for react-native-collapsible 0.8
|
||||
// Project: https://github.com/oblador/react-native-collapsible
|
||||
// Definitions by: Kyle Roach <https://github.com/iRoachie>
|
||||
// Umidbek Karimov <https://github.com/umidbekkarimov>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.6
|
||||
|
||||
|
||||
@@ -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}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"dom",
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
@@ -22,4 +23,4 @@
|
||||
"Accordion.d.ts",
|
||||
"react-native-collapsible-tests.tsx"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user