Skip to content

Commit 233a60e

Browse files
authored
Doc: documents that RN needs a crypto.randomUUID polyfill (#365)
1 parent d3898e3 commit 233a60e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docs/overview.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -885,6 +885,24 @@ const AddTodo = () => {
885885
}
886886
```
887887

888+
## React Native
889+
890+
When using TanStack DB with React Native, you need to install and configure a UUID generation library since React Native doesn't include crypto.randomUUID() by default.
891+
892+
Install the `react-native-random-uuid` package:
893+
894+
```bash
895+
npm install react-native-random-uuid
896+
```
897+
898+
Then import it at the entry point of your React Native app (e.g., in your `App.js` or `index.js`):
899+
900+
```javascript
901+
import 'react-native-random-uuid'
902+
```
903+
904+
This polyfill provides the `crypto.randomUUID()` function that TanStack DB uses internally for generating unique identifiers.
905+
888906
## More info
889907

890908
If you have questions / need help using TanStack DB, let us know on the Discord or start a GitHub discussion:

0 commit comments

Comments
 (0)