example for react-native and typescript
I created a new example for react-native in typescript that is a bit more robust than the existing one, as this one has all the same functionality as the 'native' example. I did this for myself in order to figure out how to use WatermelonDB with typescript, but figured I should create a PR incase this example would be useful to others as well.
Feel free to close if this is not wanted.
Some changes from the 'native' example:
- removed 'action' decorators from Blog and Post models (were causing errors) and replaced with 'writer'
- replaced @react-navigation/stack with @react-navigation/native-stack
- added rambdax as dependency
- removed timeToLaunch display (NativeModules.PerformancePlugin.appInitTimestamp was returning null), happy to add it back if direction is provided on best way to do this
- created new dedicated button for clearing the db
- README.md is updated to contain instructions
I also have another example that copies the 'native' example in JS but has updated versions for all dependencies in addition to the updates listed above. Let me know if that additional example would also be a valuable PR (see https://github.com/monlovesmango/WatermelonDB/tree/example-rn)
FYI the 'native' example's README.md link (https://nozbe.github.io/WatermelonDB/Demo.html) seems to be broken, gives me page not found.