-
Type: Bug
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: None
<!---
Questions: If you have questions about HOW TO use Realm, please ask on
StackOverflow: http://stackoverflow.com/questions/ask?tags=realm
We monitor the realm tag.
Feature Request: Just fill in the first two sections below.
Bugs: To help you as fast as possible with an issue please describe your issue
and the steps you have taken to reproduce it in as much detail as possible.
-->
<!--- What did you expect to happen? -->
getDogs().then((result) => { const realm = this.state.realm; realm.write(() => { const allDogs = realm.objects('Dogs'); realm.delete(allDogs); console.log('realm write'); result.mails.forEach((element) => { realm.create( 'Dogs', { id: element.id, date: element.date, name: element.name, }, true ); }); }); this.setState({ dogs: realm.objects('Dogs'), errorMessage: null }); }) .catch((error) => { this.log(error); });
Actual Results
Should have stored dogs in state. Works on android. Gets generalised message on iOS
[info][tid:com.facebook.react.JavaScript]
The same line works in constructor or render method.
P.S. The method is called from a button click.
Version of Realm and Tooling
- Realm JS SDK Version: 5.0.4
- Node or React Native: React Native
- Client OS & Version: iphone 11 - 13.3 simulator
- Which debugger for React Native: None