@onehat/ui 0.3.352 → 0.3.353

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": "@onehat/ui",
3
- "version": "0.3.352",
3
+ "version": "0.3.353",
4
4
  "description": "Base UI for OneHat apps",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -105,6 +105,7 @@ function GridComponent(props) {
105
105
  flatListProps = {},
106
106
  onRowPress,
107
107
  onRender,
108
+ disableLoadOnRender = false,
108
109
  forceLoadOnRender = false,
109
110
  pullToRefresh = true,
110
111
  hideNavColumn = true,
@@ -801,6 +802,10 @@ function GridComponent(props) {
801
802
  }
802
803
  };
803
804
 
805
+ if (forceLoadOnRender && disableLoadOnRender) {
806
+ throw new Error('incompatible config! forceLoadOnRender and disableLoadOnRender cannot both be true');
807
+ }
808
+
804
809
  useEffect(() => {
805
810
  if (!isInited) {
806
811
  // first call -- meant to render placeholder so we get container dimensions
@@ -934,7 +939,7 @@ function GridComponent(props) {
934
939
  applySelectorSelected();
935
940
  Repository.resumeEvents();
936
941
 
937
- if ((Repository.isRemote && !Repository.isLoaded) || forceLoadOnRender) {
942
+ if (((Repository.isRemote && !Repository.isLoaded) || forceLoadOnRender) && !disableLoadOnRender) { // default remote repositories to load on render, optionally force or disable load on render
938
943
  Repository.load();
939
944
  }
940
945