oblador / react-native-collapsible

Animated collapsible component for React Native, good for accordions, toggles etc
MIT License
2.42k stars 455 forks source link

Typescript CollapsibleProps doesn't contain childre #436

Open teyalite opened 2 years ago

teyalite commented 2 years ago

There is no property children?: React.ReactNode; in CollapsibleProps.

mohandarsi commented 2 years ago

image

MikeyAlmighty commented 2 years ago

Hi @teyalite Did you find a potential workaround for this?

teyalite commented 2 years ago

@MikeyAlmighty yes, i added the child prop to it in the source file in node_modules

kaolin commented 2 years ago

FWIW ~

diff --git a/node_modules/react-native-collapsible/index.d.ts b/node_modules/react-native-collapsible/index.d.ts
index 26f8d56..7acf736 100644
--- a/node_modules/react-native-collapsible/index.d.ts
+++ b/node_modules/react-native-collapsible/index.d.ts
@@ -93,6 +93,12 @@ export interface CollapsibleProps {
    * Function called when the animation finished
    */
   onAnimationEnd?: () => void;
+
+  /**
+   * Children! https://github.com/oblador/react-native-collapsible/issues/436
+   */
+  children?: React.ReactNode;
+
 }

 export default class Collapsible extends React.Component<CollapsibleProps> {}
kubik369 commented 2 years ago

This is due to the update to React 18, where children props need to be stated in the type explicitly.

@oblador Would you accept a PR with this single change? AFAIK it does not affect older versions. Thanks for the reply :)

Andreas-Sujono commented 2 years ago

@oblador still get this issue

marioacero commented 1 year ago

@oblador could you add that fix?

makarewicz77 commented 1 year ago

I'm also facing the issue and would appreciate a fix for this one. I'm not considering changing the index.d.ts from node_modules as a proper solution.

bobness commented 1 year ago

Same. Please fix! I'll put @ts-expect-error for now... 👿

doug-shontz commented 1 year ago

I see this has been merged in a PR. https://github.com/oblador/react-native-collapsible/pull/432. Could it please be published?

kvika-kristin commented 1 year ago

@oblador This is still causing a problem, would it be possible to publish a new version including the fix that was merged in #432 ?

oscar-shamrock commented 1 year ago

this has been fixed?

oscar-shamrock commented 1 year ago

ii saw is merged but when i install the package is not fixed

bads77 commented 1 year ago

Hi, any plans on fixing this?

stevekuznetsov commented 1 month ago

Looks like v1.6.1 released that fix. @oblador we can close this issue out!