plotline-engage 4.1.9 → 4.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/android/build.gradle +1 -1
- package/index.d.ts +2 -3
- package/index.js +9 -5
- package/package.json +1 -1
package/android/build.gradle
CHANGED
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { NavigationContainer as RNNavigationContainer } from '@react-navigation/native';
|
|
3
3
|
|
|
4
4
|
declare class plotline {
|
|
5
5
|
track(eventName: string, properties: {[key: string]: string}): void;
|
|
@@ -16,8 +16,7 @@ declare class plotline {
|
|
|
16
16
|
logout(): void;
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
declare
|
|
20
|
-
}
|
|
19
|
+
declare const NavigationContainer = RNNavigationContainer;
|
|
21
20
|
|
|
22
21
|
interface PlotlineWidgetProps extends ViewProps {
|
|
23
22
|
testID?: string;
|
package/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import { NativeModules, DeviceEventEmitter, Platform, NativeEventEmitter, requireNativeComponent } from 'react-native';
|
|
3
3
|
import { View } from 'react-native';
|
|
4
|
-
import React, { useEffect, useState } from 'react';
|
|
4
|
+
import React, { useEffect, useState, forwardRef } from 'react';
|
|
5
5
|
const { RNPlotline } = NativeModules;
|
|
6
6
|
import { NavigationContainer as RNNavigationContainer, useNavigationContainerRef } from '@react-navigation/native';
|
|
7
7
|
|
|
@@ -199,7 +199,7 @@ const PlotlineWidget = ({ testID }) => {
|
|
|
199
199
|
return null;
|
|
200
200
|
};
|
|
201
201
|
|
|
202
|
-
const NavigationContainer = ({children, ...others}) => {
|
|
202
|
+
const NavigationContainer = forwardRef(({children, ...others}, ref) => {
|
|
203
203
|
const containerRef = useNavigationContainerRef()
|
|
204
204
|
|
|
205
205
|
useEffect(() => {
|
|
@@ -221,14 +221,18 @@ const NavigationContainer = ({children, ...others}) => {
|
|
|
221
221
|
|
|
222
222
|
return (
|
|
223
223
|
<RNNavigationContainer
|
|
224
|
-
onStateChange={handleStateChange}
|
|
225
224
|
{...others}
|
|
226
|
-
|
|
225
|
+
onStateChange={handleStateChange}
|
|
226
|
+
ref={(node) => {
|
|
227
|
+
containerRef.current = node;
|
|
228
|
+
if (typeof ref === 'function') ref(node);
|
|
229
|
+
else if (ref) ref.current = node;
|
|
230
|
+
}}
|
|
227
231
|
>
|
|
228
232
|
{children}
|
|
229
233
|
</RNNavigationContainer>
|
|
230
234
|
)
|
|
231
|
-
}
|
|
235
|
+
});
|
|
232
236
|
|
|
233
237
|
export default Plotline;
|
|
234
238
|
export {PlotlineWidget, NavigationContainer};
|