I'm trying to assign another name to context in a class component to customize my code.
static contextType = MyContext;
this.customContext = this.context;
I also tried to assign it in the constructor.
but I receive undefined customContext (this.context returns right value).
Are you sure that this.context have value?
Maybe you assigning to customContext variable that are not yet passed?