Replies: 2 comments 1 reply
|
This behavior is expected when working with custom stores in Jotai. By default, Because How to resolve:You need to pass the same custom store instance to the import { createStore, Provider } from 'jotai';
import { DevTools } from 'jotai-devtools';
const myStore = createStore();
const App = () => {
return (
<Provider store={myStore}>
{/* Pass the same store instance here */}
<DevTools store={myStore} />
<YourAppComponents />
</Provider>
);
};If you are using debug hooks instead of the import { useAtomsDevtools } from 'jotai-devtools/utils';
// inside your component
useAtomsDevtools('My App Name', { store: myStore }); |
|
Jotai's If you configure your To fix this, you must explicitly pass your custom store instance directly as a prop to the import { Provider, createStore } from 'jotai';
import { DevTools } from '@jotai/devtools';
const myCustomStore = createStore();
export default function App() {
return (
<Provider store={myCustomStore}>
{/* Pass the custom store instance directly to DevTools */}
<DevTools store={myCustomStore} />
<MyComponents />
</Provider>
);
}Similarly, if you are utilizing the hooks API to connect to devtools, ensure you pass the custom store as an option to the hook: useAtomsDevtools("AppDevTools", { store: myCustomStore }); |
Uh oh!
There was an error while loading. Please reload this page.
Hi, when i import specific store with atoms set inside it inside and Devtools see no atoms at all.
But they start to see atoms if i import completely different empty store.
And they also work if i use default store
I'm trying jotai because of native ui devtools and ease of debuging in electron and this problem is very disappointing :(
All reactions