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.
@@ -39,6 +39,6 @@ repositories {
39
39
 
40
40
  dependencies {
41
41
  implementation 'com.facebook.react:react-native:+'
42
- implementation 'com.gitlab.plotline:plotline-android-sdk:3.4.2'
42
+ implementation 'com.gitlab.plotline:plotline-android-sdk:3.4.4'
43
43
  }
44
44
 
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { NavigationContainerProps } from '@react-navigation/native';
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 class NavigationContainer extends React.Component<NavigationContainerProps> {
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
- ref={containerRef}
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};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "plotline-engage",
3
- "version": "4.1.9",
3
+ "version": "4.2.1",
4
4
  "description": "React Native plugin for Plotline",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"