You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to convince a friend of mine that he should only put serializable data types into React component state, then he gave me this link with an example of how Facebook add a function into component's state: https://reactjs.org/docs/context.html
This is the snippet:
Can someone help me to understand why we have to do this in the example code? Isn't it an anti-pattern?