Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions docs-website/docs/docs/Installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,34 @@ Follow [instructions on React Native Windows website](https://microsoft.github.i

</details>

## Expo setup

The following steps are required to use WatermelonDB with Expo:

1. Install the Babel plugin for decorators:

```sh
expo install @babel/plugin-proposal-decorators
```

2. Add the plugin to your `babel.config.js` file:

```js
module.exports = (api) => {
api.cache(true);

return {
presets: [['babel-preset-expo'], 'nativewind/babel'],

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Either the PR is incomplete or it doesn't work because just having babel plugins won't make WatermelonDB work on Expo as there's no SQLite available unless you use Expo SQLite plugin.

The preferable approach should be a new adopted SQLiteExpo under the adapters that operates on SQLite via Expo and rest of the machinery should work out of the box. For the web, could use sql.js


plugins: [['@babel/plugin-proposal-decorators', { legacy: true }]],
};
};
```

3. Run `expo prebuild` to ensure the plugin is included in the build.

4. Run the app using `expo start`.

## NodeJS (SQLite) setup

You only need this if you want to use WatermelonDB in NodeJS with SQLite (e.g. for scripts that share code with your web/React Native app)
Expand Down