Skip to content

Can I use jotai-devtools in react native apps? #56

Answered by arjunvegda
zerosrat asked this question in Q&A
Discussion options

You must be logged in to vote

<DevTools/> is web-only. For React Native apps, we currently recommend using Redux DevTools as a debugging solution via the useatomsdevtools.

We'll need to import the hook using a second entry point (without the @mantine/core) to do this.

Eg.

import { useAtomsDevtools } from 'jotai-devtools/utils';

export const DevTools = () => {
  useAtomsDevtools('store-name-here');
  return null;
};

If you're using Expo or Metro to bundle your RN app, you may run into issues with this entry point above due to Expo/Metro's experimental support for export. This comment might help in that case

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@zerosrat
Comment options

Answer selected by zerosrat
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants