type Context = Record < string , any > ; let context = { } ; export const useContext = < T extends Context = Context > ( initialContext ? ) => { if ( initialContext ) { context = initialContext ; } return context as T ; } ;