I'm using DrizzleContext of drizzle-react package. I'm deriving the context object using the following code:

static contextType = DrizzleContext.Consumer;

the derived context object is then obtained using this code:

constructor(props, context) {
        this.context = context;

recently I've been getting the following error for every js file which leverages context object as above:

Warning: myJS defines an invalid contextType. contextType should point to the Context object returned by React.createContext(). Did you accidentally pass the Context.Consumer instead?

Any idea what this is regarding?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.