Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Patch for ChildrenWithProps #166

Open
Qwin opened this issue Oct 17, 2022 · 2 comments
Open

Patch for ChildrenWithProps #166

Qwin opened this issue Oct 17, 2022 · 2 comments

Comments

@Qwin
Copy link

Qwin commented Oct 17, 2022

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch react-native-walkthrough-tooltip@1.4.0 for the project I'm working on.

Here is the diff that solved my problem:

diff --git a/node_modules/react-native-walkthrough-tooltip/src/tooltip.d.ts b/node_modules/react-native-walkthrough-tooltip/src/tooltip.d.ts
index 5a7ef59..bd497f9 100644
--- a/node_modules/react-native-walkthrough-tooltip/src/tooltip.d.ts
+++ b/node_modules/react-native-walkthrough-tooltip/src/tooltip.d.ts
@@ -2,7 +2,7 @@
 // Original definitions by: Siraj Alam https://github.com/sirajalam049
 
 declare module 'react-native-walkthrough-tooltip' {
-  import React from 'react';
+  import React, { PropsWithChildren } from 'react';
   import { GestureResponderEvent, StyleProp, ViewStyle } from 'react-native';
 
   type Orientation =
@@ -166,7 +166,7 @@ declare module 'react-native-walkthrough-tooltip' {
         </Tooltip>
     ```
      */
-  class Tooltip extends React.Component<TooltipProps> {}
+  class Tooltip extends React.Component<PropsWithChildren<TooltipProps>> {}
 
   export default Tooltip;
 }

This issue body was partially generated by patch-package.

@wonecode
Copy link

Hi, it looks not working to me using patch-package, i got the following error from running patch-package command, have you an idea to solve it ?

❯ yarn patch-package --use-yarn react-native-walkthrough-tooltip
yarn run v1.22.19
$ /Users/*****/Documents/Dev/Marelis/marelis-quality-form/node_modules/.bin/patch-package --use-yarn react-native-walkthrough-tooltip
patch-package 6.5.0
• Creating temporary folder
• Installing react-native-walkthrough-tooltip@1.4.0 with yarn
• Diffing your files with clean files
⁉️  Not creating patch file for package 'react-native-walkthrough-tooltip'
⁉️  There don't appear to be any changes.

@MustagheesButt
Copy link

I get this warning while using with typescript:

No overload matches this call.
  Overload 1 of 2, '(props: TooltipProps | Readonly<TooltipProps>): Tooltip', gave the following error.
    Type '{ children: Element; isVisible: boolean; content: Element; onClose: () => void; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Tooltip> & Readonly<TooltipProps>'.
      Property 'children' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<Tooltip> & Readonly<TooltipProps>'.
  Overload 2 of 2, '(props: TooltipProps, context: any): Tooltip', gave the following error.
    Type '{ children: Element; isVisible: boolean; content: Element; onClose: () => void; }' is not assignable to type 'IntrinsicAttributes & IntrinsicClassAttributes<Tooltip> & Readonly<TooltipProps>'.
      Property 'children' does not exist on type 'IntrinsicAttributes & IntrinsicClassAttributes<Tooltip> & Readonly<TooltipProps>'

Maybe it's related to this issue.

wemsaji added a commit to wemsaji/react-native-walkthrough-tooltip that referenced this issue Dec 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants