UNPKG

@tomino/dynamic-form-semantic-ui

Version:

Semantic UI form renderer based on dynamic form generation

26 lines (21 loc) 486 B
import React from 'react'; import { AlertManager } from 'react-alert'; import { observable } from 'mobx'; type User = { name?: string; id?: string; roles?: string[]; }; export type ContextType = { alert?: AlertManager; authToken?: string; auth: { user?: User; logout?: Function }; app: any; }; export const context: ContextType = { alert: null, authToken: null, auth: observable({ user: null }), app: {} }; export const Context = React.createContext(context);