@onehat/ui 0.3.350 → 0.3.351
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,4 +1,4 @@
|
|
|
1
|
-
import { useRef, useState, } from 'react';
|
|
1
|
+
import { useEffect, useRef, useState, } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
Column,
|
|
4
4
|
Icon,
|
|
@@ -37,7 +37,8 @@ function Viewer(props) {
|
|
|
37
37
|
record,
|
|
38
38
|
additionalViewButtons,
|
|
39
39
|
canRecordBeEdited,
|
|
40
|
-
|
|
40
|
+
viewerSetup, // this fn will be executed after the viewer setup is complete
|
|
41
|
+
|
|
41
42
|
// withComponent
|
|
42
43
|
self,
|
|
43
44
|
|
|
@@ -235,6 +236,12 @@ function Viewer(props) {
|
|
|
235
236
|
setContainerWidth(e.nativeEvent.layout.width);
|
|
236
237
|
};
|
|
237
238
|
|
|
239
|
+
useEffect(() => {
|
|
240
|
+
if (viewerSetup && record?.getSubmitValues) {
|
|
241
|
+
viewerSetup(record.getSubmitValues());
|
|
242
|
+
}
|
|
243
|
+
}, [record]);
|
|
244
|
+
|
|
238
245
|
if (self) {
|
|
239
246
|
self.ref = scrollViewRef;
|
|
240
247
|
}
|