heap / react-native-heap

A React Native integration for Heap
MIT License
81 stars 36 forks source link

React 18.2.0 Typescript fix for <HeapIgnore> #407

Closed jkoutavas closed 1 year ago

jkoutavas commented 1 year ago

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch @heap/react-native-heap@0.22.4 for the project I'm working on.

<HeapIgnore> is generating a tsc error, it's not compatible with React 18.2.0's new way of handling children. Here is the diff that solved my problem:

diff --git a/node_modules/@heap/react-native-heap/index.d.ts b/node_modules/@heap/react-native-heap/index.d.ts
index c819508..5425981 100644
--- a/node_modules/@heap/react-native-heap/index.d.ts
+++ b/node_modules/@heap/react-native-heap/index.d.ts
@@ -137,6 +137,7 @@ export interface HeapIgnoreProps {
     allowInnerHierarchy?: boolean | undefined;
     allowAllProps?: boolean | undefined;
     allowTargetText?: boolean | undefined;
+    children?: React.ReactNode;
 }

 /**

This issue body was partially generated by patch-package.