import React from 'react' ; import crayon from 'crayon' ; export const withContext = < T = any > ( context , value ? ) => { const apply = ( Component ) => ( ) => React . createElement ( context . Provider , { value } , React . createElement ( Component , null ) ) ; return ( ctx ) => { const _mount = ctx . mount ; ctx . mount = ( c ) => { return _mount ( apply ( c ) ) ; } ; } ; } ;