I learned this manual https://reactjs.org/docs/context.html
And wrote this code
UserContext.js:
import React from 'react';
const UserContext = R...
For further actions, you may consider blocking this person and/or reporting abuse
Are you getting any errors?
getAccountData
needs to bindthis
in constructor or should be declared with an arrow syntax.No mistakes
If i write
then it will work.
this attaches correctly. But setState or timers do not change the object that is inside UserContext.Consumer