@haroldtran/react-native-modals 0.0.2 → 0.0.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haroldtran/react-native-modals",
3
- "version": "0.0.2",
3
+ "version": "0.0.4",
4
4
  "description": "React Native Modals Library for IOS & Android.",
5
5
  "main": "/src/index.tsx",
6
6
  "scripts": {
@@ -79,5 +79,9 @@
79
79
  "modals-example/node_modules"
80
80
  ]
81
81
  },
82
- "packageManager": "yarn@4.9.2"
82
+ "packageManager": "yarn@4.9.2",
83
+ "trustedDependencies": [
84
+ "core-js",
85
+ "fsevents"
86
+ ]
83
87
  }
@@ -134,7 +134,12 @@ class ModalPortal extends React.Component<{}, { stack: StackItem[] }> {
134
134
  };
135
135
 
136
136
  render() {
137
- return this.state.stack.map(this.renderModal);
137
+ return this.state?.stack
138
+ ?.filter(
139
+ (item, index, self) =>
140
+ index === self?.findIndex((t) => t?.key === item?.key),
141
+ )
142
+ ?.map(this.renderModal);
138
143
  }
139
144
  }
140
145
 
@@ -278,7 +278,7 @@ class BaseModal extends Component<ModalProps, State> {
278
278
  ]}
279
279
  >
280
280
  {modalTitle}
281
- {children}
281
+ {modalState === MODAL_OPENED && children}
282
282
  {footer}
283
283
  </Animated.View>
284
284
  </Animated.View>