You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
-15Lines changed: 0 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -206,21 +206,6 @@ export default App;
206
206
207
207
It's also beneficial to use a [selector](https://github.com/Expensify/react-native-onyx/blob/main/API.md#connectmapping--number) with the mapping in case you need to grab a single item in a collection (like a single report action).
208
208
209
-
### useOnyx()'s `canBeMissing` option
210
-
211
-
You must pass the `canBeMissing` configuration flag to `useOnyx` if you want the hook to log an alert when data is missing from Onyx store. Regarding usage in `Expensify/App` repo, if the component calling this is the one loading the data by calling an action, then you should set this to `true`. If the component calling this does not load the data then you should set it to `false`, which means that if the data is not there, it will log an alert, as it means we are using data that no one loaded and that's most probably a bug.
212
-
213
-
```javascript
214
-
constComponent= ({reportID}) => {
215
-
// This hook will log an alert (via `Logger.logAlert()`) if `report` is `undefined`.
Collections allow keys with similar value types to be subscribed together by subscribing to the collection key. To define one, it must be included in the `ONYXKEYS.COLLECTION` object and it must be suffixed with an underscore. Member keys should use a unique identifier or index after the collection key prefix (e.g. `report_42`).
thrownewError(`Invalid '${key}' key provided, only collection keys are allowed.`);
574
+
returnundefined;
579
575
}
580
576
581
577
/**
@@ -754,13 +750,7 @@ function keyChanged<TKey extends OnyxKey>(
754
750
// do the same in keysChanged, because we only call that function when a collection key changes, and it doesn't happen that often.
755
751
// For performance reason, we look for the given key and later if don't find it we look for the collection key, instead of checking if it is a collection key first.
0 commit comments