@ukhomeoffice/cop-react-form-renderer 5.24.2 → 5.24.3

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.
@@ -41,16 +41,9 @@ var CollectionPage = function CollectionPage(_ref) {
41
41
  _useState2 = _slicedToArray(_useState, 2),
42
42
  patch = _useState2[0],
43
43
  setPatch = _useState2[1];
44
- var _useState3 = (0, _react.useState)(_utils.default.CollectionPage.getData(page.collection.name, page.formData) || []),
45
- _useState4 = _slicedToArray(_useState3, 2),
46
- data = _useState4[0],
47
- setData = _useState4[1];
44
+ var data = _utils.default.CollectionPage.getData(page.collection.name, page.formData) || [];
48
45
  var currentCollectionName = page.collection.name.split('.').pop();
49
46
  var activeIndex = _utils.default.CollectionPage.getActiveIndex(page.collection.name, page.formData);
50
- (0, _react.useEffect)(function () {
51
- // This makes sure that the page is correctly populated on a refresh.
52
- setData(_utils.default.CollectionPage.getData(page.collection.name, page.formData) || []);
53
- }, [page.formData]);
54
47
 
55
48
  /**
56
49
  * Handle the state of the data directly within the page.
@@ -61,7 +54,7 @@ var CollectionPage = function CollectionPage(_ref) {
61
54
  var onPageChange = function onPageChange(_ref2) {
62
55
  var target = _ref2.target;
63
56
  _utils.default.CollectionPage.setData(currentPage.collection.name, target.value, page.formData);
64
- setData(target.value);
57
+ data = target.value;
65
58
  var parentCollection = page.collection.name.split('.').shift();
66
59
  // Because of the way that patch is applied to the submission data
67
60
  // later (in onPageAction.js), we have to record the entire top-level
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ukhomeoffice/cop-react-form-renderer",
3
- "version": "5.24.2",
3
+ "version": "5.24.3",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "clean": "rimraf dist",