Skip to content

Commit

Permalink
React Native: Remove bad onError configuration (#3064)
Browse files Browse the repository at this point in the history
## Pull Request Info

Several of our examples had a bad error handler construction. This PR
removes that construction. In all cases, the error handling bit wasn't
necessary.

### Staged Changes

[Multiple places in the React Native
docs](https://preview-mongodbkrollinsmdb.gatsbyjs.io/realm/remove-bad-on-error/sdk/react-native/)

### Review Guidelines


[REVIEWING.md](https://github.com/mongodb/docs-realm/blob/master/REVIEWING.md)

### Animal Wearing a Hat

<img
src="https://i.etsystatic.com/5376657/r/il/233f4d/650177589/il_570xN.650177589_rgoj.jpg"
width=400>
  • Loading branch information
krollins-mdb authored Nov 2, 2023
1 parent 4cc6ba7 commit 8f7137a
Show file tree
Hide file tree
Showing 14 changed files with 4 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ function AppWrapperSync() {
<RealmProvider
sync={{
flexible: true,
onError: console.error,
initialSubscriptions: {
update(subs, realm) {
subs.add(realm.objects('Profile'));
Expand Down Expand Up @@ -131,7 +130,6 @@ const createConfig = user => {
sync: {
user: user,
flexible: true,
onError: console.error,
},
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ const createConfig = user => {
sync: {
user: user,
flexible: true,
onError: console.error,
},
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ const createConfig = user => {
sync: {
user: user,
flexible: true,
onError: console.error,
},
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,7 @@ function AppWrapperSync() {
return (
<AppProvider id={APP_ID}>
<UserProvider fallback={LogIn}>
<RealmProvider
sync={{
flexible: true,
onError: console.error,
}}>
<RealmProvider sync={{flexible: true}}>
<App />
</RealmProvider>
</UserProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ function AppWrapperSync() {
<RealmProvider
sync={{
flexible: true,
onError: console.error,
initialSubscriptions: {
update(subs, realm) {
subs.add(realm.objects('Profile'));
Expand Down Expand Up @@ -132,7 +131,6 @@ const createConfig = (user: Realm.User): Realm.ConfigurationWithSync => {
sync: {
user: user,
flexible: true,
onError: console.error,
},
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ function AppWrapperOfflineSync() {
flexible: true,
newRealmFileBehavior: realmAccessBehavior,
existingRealmFileBehavior: realmAccessBehavior,
onError: console.error,
}}>
<RestOfApp />
</RealmProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ const createConfig = (user: Realm.User): Realm.Configuration => {
sync: {
user: user,
flexible: true,
onError: console.error,
},
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ const createConfig = (user: Realm.User): Realm.Configuration => {
sync: {
user: user,
flexible: true,
onError: console.error,
},
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,7 @@ function AppWrapperSync() {
return (
<AppProvider id={APP_ID}>
<UserProvider fallback={LogIn}>
<RealmProvider
sync={{
flexible: true,
onError: console.error,
}}>
<RealmProvider sync={{flexible: true}}>
<App />
</RealmProvider>
</UserProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ function AppWrapperSync() {
return (
<AppProvider id={APP_ID}>
<UserProvider fallback={LogIn}>
<RealmProvider
sync={{
flexible: true,
onError: console.error,
}}>
<RealmProvider sync={{flexible: true}}>
<App />
</RealmProvider>
</UserProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ function AppWrapperSync() {
<RealmProvider
sync={{
flexible: true,
onError: console.error,
initialSubscriptions: {
update(subs, realm) {
subs.add(realm.objects('Profile'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ function AppWrapperOfflineSync() {
flexible: true,
newRealmFileBehavior: realmAccessBehavior,
existingRealmFileBehavior: realmAccessBehavior,
onError: console.error,
}}>
<RestOfApp />
</RealmProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@ function AppWrapperSync() {
return (
<AppProvider id={APP_ID}>
<UserProvider fallback={LogIn}>
<RealmProvider
sync={{
flexible: true,
onError: console.error,
}}>
<RealmProvider sync={{flexible: true}}>
<App />
</RealmProvider>
</UserProvider>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ function AppWrapperSync() {
<RealmProvider
sync={{
flexible: true,
onError: console.error,
initialSubscriptions: {
update(subs, realm) {
subs.add(realm.objects('Profile'));
Expand Down

0 comments on commit 8f7137a

Please sign in to comment.