When I make a component that relies on something like the currently chosen language for example, or maybe a special query function to fetch data, and I provide either of these things via a ContextProvider and I make use of them with useContext(), does this not create a hidden dependency? Essentially a dependency on a sort of global-ish variable?
When defining properties on the function of a functional component, if I am missing arguments/properties when writing my TSX/typescript I will get a warning, because the function's contract/interface/signature is defined and can be statically analyzed and checked.
So, am I wrong to say that this can't be done at all with contexts? If someone were to reuse the components and the documentation did not announce the dependency it could be an issue, no? Can one use the context API and still have some sort of static dependency checking, or must one use component props / functional args to ensure dependencies are met?
If the context API does hide dependencies, why do people use it?
Addendum:
I thought all of this was relatively clear, but I will clarify that ultimately I am asking whether when importing and using a component that depends on context, if it is somehow apparent in any IDE what context it requires, without looking into its internal code or reading documentation, before runtime.