jotaijs / jotai-devtools

A powerful toolkit to enhance your development experience with Jotai
https://jotai.org/docs/tools/devtools
MIT License
134 stars 33 forks source link

Remove dependencies that does not support React Native #39

Closed madsbuch closed 1 year ago

madsbuch commented 1 year ago

We just had to stop using jotai-devtools as it includes a dependency on the https://mantine.dev/ framework.

Generally, it would be nice if packages like this one were headless and do not expect a document or to be run in a browser.

Anyways, nice work and thanks for the time we got to have together!

arjunvegda commented 1 year ago

Sorry to hear that! I'd love to learn more about your issues and see if we could help fix those.

Could you elaborate a little on the error/problem you're seeing? Are you using the new <DevTools/> or the dev tools hooks?

madsbuch commented 1 year ago

The main issue is that Mantine assumes that the document property is available, which it is not in react native.

We previously used a structure like this:

useAtomsDevtools("GlobalStore", {
     store: store.instance,
});

In particular, our usage pattern, as is evident, does not keep everything in the react world, and we greatly appreciate the first-class store support!

arjunvegda commented 1 year ago

So would importing the useAtomsDevtools from a separate entry (/utils) without a reference to @mantine/* fix the issue?

Could you try import { useAtomsDevtools } from 'jotai-devtools/utils'?