drf-react-by-schema 0.6.4 → 0.6.5

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.
@@ -436,7 +436,7 @@ const DataGridBySchemaEditable = (0, react_1.forwardRef)((_a, ref) => {
436
436
  updateOptionsAC().then(() => {
437
437
  initColumns();
438
438
  });
439
- }, [rowModesModel]);
439
+ }, [rowModesModel, columns]);
440
440
  const processRowUpdate = (newRow) => __awaiter(void 0, void 0, void 0, function* () {
441
441
  if (!preparedColumns || !yupValidationSchema.current) {
442
442
  return false;
@@ -50,6 +50,10 @@ const APIWrapperContext_1 = require("../context/APIWrapperContext");
50
50
  const GenericModelList = ({ columnFields, hiddenFields = [], minWidthFields, indexFieldBasePath, indexField, customColumnOperations, customLinkDestination, sumRows, isAutoHeight = true, model, forceReload = false, LinkComponent = null, hasHeader = false, paginationMode = 'client', }) => {
51
51
  const context = react_1.default.useContext(DRFReactBySchemaContext_1.DRFReactBySchemaContext);
52
52
  const apiContext = react_1.default.useContext(APIWrapperContext_1.APIWrapperContext);
53
+ if (!apiContext) {
54
+ console.log('ERRO: É necessário haver o apiContext para gerar este componente!');
55
+ return react_1.default.createElement(react_1.default.Fragment, null);
56
+ }
53
57
  const { serverEndPoint, isInBatches, firstBatchLength } = context;
54
58
  const { handleLoading } = apiContext;
55
59
  const [data, setData] = (0, react_1.useState)(false);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "drf-react-by-schema",
3
- "version": "0.6.4",
3
+ "version": "0.6.5",
4
4
  "description": "Components and Tools for building a React App having Django Rest Framework (DRF) as server",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",