Skip to content

Commit afcc9b3

Browse files
DominicGBauerDominicGBauerbenitav
authored
docs(react-native): add note about metro config (#326)
Co-authored-by: DominicGBauer <[email protected]> Co-authored-by: benitav <[email protected]>
1 parent 6641232 commit afcc9b3

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

packages/react-native/README.md

+29
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,35 @@ module.exports = function (api) {
7171
};
7272
```
7373

74+
## Metro config (optional)
75+
76+
When using a bare React Native app without a framework like Expo, the `@powersync/react-native` package does not work well with inline requires.
77+
78+
If you see the following error message
79+
80+
81+
```bash
82+
Super expression must either be null or a function
83+
```
84+
85+
then you will need to add this to your `metro.config.js`:
86+
87+
```js
88+
const config = {
89+
transformer: {
90+
getTransformOptions: async () => ({
91+
transform: {
92+
inlineRequires: {
93+
blockList: {
94+
[require.resolve("@powersync/react-native")]: true,
95+
},
96+
},
97+
},
98+
})
99+
}
100+
};
101+
```
102+
74103
# Native Projects
75104

76105
This package uses native libraries. Create native Android and iOS projects (if not created already) by running:

0 commit comments

Comments
 (0)