CodeZettaInterview Hub

React · Context · Mid-Level · Debugging

Pitfall: providing a new context default object.

Short Interview Answer

Default values are only used without a Provider; mutating defaults is bad; usually require a Provider.

Detailed Explanation

Throw in useX() if missing provider for clearer DX.

Did you know this answer?