Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

example for react-native and typescript #1670

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

monlovesmango
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant