DEV Community

Discussion on: React, TypeScript & Mobx

Collapse
 
gruckion profile image
Stephen Rayner

You forgot to tell the user to install uuid @types/uuid mobx. Also you have no examples of RootStoreModel anywhere.

In rootStore.ts you are importing UserStore.ts and AuthStore.ts but then you have your UserStore.ts also importing RootStoreModel from rootStore.

/**
 * import RootStoreModel
 * Dependency cycle detected.eslintimport/no-cycle
 * Module '"./rootStore"' has no exported member 'RootStoreModel'.ts(2305)
 * Peek Problem (⌥F8)
 * Quick Fix... (⌘.)
 **/
import { RootStoreModel } from "./rootStore";
Enter fullscreen mode Exit fullscreen mode
Collapse
 
mdekaj profile image
MDEKAJ

Hi, is there any examples of RootStoreModel? I'm a bit confused where it fits in...

Collapse
 
staschek profile image
Staschek

This works for me:

import React, { FC, createContext, ReactNode, ReactElement } from 'react';
import { RootStore, rootStore } from '../root/root.store';

export const StoreContext = createContext<RootStore>(rootStore);
Enter fullscreen mode Exit fullscreen mode