react-dynamic-context
This Documentation is currently under construction
Type-safe dynamic context with only a few lines of code.
install
yarn add react-dynamic-context# or npm i react-dynamic-context
basic example
;; ; ;
live-examples on codesandbox:
optional values for context-value-interface
The interface must not contain any optional values:
; // ERROR: Type '{ foo?: string | undefined; }' does not satisfy the constraint 'Required<{ foo?: string | undefined; }>'.createDynamicContext; // CORRECT:createDynamicContext;
further reading
advanced example
;;; ; ; ; ; ReactDOM.render, document.getElementById'root' as HTMLElement;