UNPKG

mini-react-dom

Version:

A lightweight React-like DOM renderer with JSX, hooks, context, SSR and lazy support

15 lines (13 loc) 284 B
export function createContext(defaultValue) { const context = { Provider: ({ value, children }) => { context._value = value; return children; }, _value: defaultValue, }; return context; } export function useContext(Context) { return Context._value; }