react-native-collapsible icon indicating copy to clipboard operation
react-native-collapsible copied to clipboard

Typescript CollapsibleProps doesn't contain childre

Open teyalite opened this issue 2 years ago • 15 comments

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

teyalite avatar May 01 '22 14:05 teyalite

image

mohandarsi avatar May 25 '22 15:05 mohandarsi

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

MikeyAlmighty avatar Jun 01 '22 07:06 MikeyAlmighty

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

teyalite avatar Jun 01 '22 09:06 teyalite

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> {}

kaolin avatar Jun 01 '22 18:06 kaolin

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 :)

kubik369 avatar Jun 22 '22 08:06 kubik369

@oblador still get this issue

Andreas-Sujono avatar Jul 07 '22 10:07 Andreas-Sujono

@oblador could you add that fix?

marioacero avatar Aug 10 '22 16:08 marioacero

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.

makarewicz77 avatar Aug 18 '22 20:08 makarewicz77

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

bobness avatar Aug 30 '22 21:08 bobness

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

doug-shontz avatar Sep 12 '22 19:09 doug-shontz

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

kvika-kristin avatar Oct 18 '22 18:10 kvika-kristin

this has been fixed?

oscar-shamrock avatar Jan 31 '23 21:01 oscar-shamrock

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

oscar-shamrock avatar Jan 31 '23 21:01 oscar-shamrock

Hi, any plans on fixing this?

bads77 avatar Feb 11 '23 07:02 bads77