react-mutable-context
Create a React context that can be accessed and mutated with hooks.
Installation
$ npm install --save react-mutable-context
Usage
; const context = ; const Provider: ColorProvider use: useColor = context; { return <ColorProvider> <ColorUser /> </ColorProvider> ;} { const color setColor = ; const handleClick = ; return <div style= color > <div>Using color from the context!</div> <div> <button type="button" onClick=handleClick> Change color </button> </div> </div> ;} // The value can also be read and changed outside of React components;