@bento-core/table 1.0.1-ccdihub.98 → 1.0.1-ccdihub.99

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.
@@ -67,12 +67,12 @@ const CPIModal = _ref => {
67
67
  } = _ref;
68
68
  const [sortBy, setSortBy] = (0, _react.useState)('associated_id');
69
69
  const [sortOrder, setSortOrder] = (0, _react.useState)('asc');
70
- const [data, setData] = (0, _react.useState)(() => {
71
- const result = row.cpi_data;
72
- return result;
73
- });
70
+ const [data, setData] = (0, _react.useState)(row.cpi_data);
74
71
  const [selectedIds, setIds] = (0, _react.useState)([]);
75
72
  const [selectAll, setSelectAll] = (0, _react.useState)(false);
73
+ (0, _react.useEffect)(() => {
74
+ setData(row.cpi_data);
75
+ }, [row]);
76
76
  const wrapperConfig = {
77
77
  container: 'buttons',
78
78
  size: 'xl',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bento-core/table",
3
- "version": "1.0.1-ccdihub.98",
3
+ "version": "1.0.1-ccdihub.99",
4
4
  "main": "dist/index.js",
5
5
  "scripts": {
6
6
  "build": "npm run lint && cross-env-shell rm -rf dist && NODE_ENV=production BABEL_ENV=es babel src --out-dir dist --copy-files",
@@ -1,4 +1,4 @@
1
- import React, { useState } from 'react';
1
+ import React, { useState, useEffect } from 'react';
2
2
  import {
3
3
  Box,
4
4
  Checkbox,
@@ -72,13 +72,14 @@ const CPIModal = ({
72
72
  }) => {
73
73
  const [sortBy, setSortBy] = useState('associated_id');
74
74
  const [sortOrder, setSortOrder] = useState('asc');
75
- const [data, setData] = useState(() => {
76
- const result = row.cpi_data;
77
- return result;
78
- });
75
+ const [data, setData] = useState(row.cpi_data);
79
76
  const [selectedIds, setIds] = useState([]);
80
77
  const [selectAll, setSelectAll] = useState(false);
81
78
 
79
+ useEffect(() => {
80
+ setData(row.cpi_data);
81
+ }, [row]);
82
+
82
83
  const wrapperConfig = {
83
84
  container: 'buttons',
84
85
  size: 'xl',