Patrick Dubroy @dubroy.com · Oct 26

To be clear, I'm only talking about those 4 functions. Take useContext, why do you say this doesn't involve hidden state? And how is Provider/useContext not dynamic scoping? (Just using the standard trick to emulate dynamic scoping in a lexically-scoped lang, set and restore a long-lived var.)

2 likes 1 replies

?

Replies

Jake Lazaroff · Oct 26

oh i see what you mean. yeah, context is def dynamic scoping; i guess it doesn't feel "hooks-style" to me because it precedes hooks (you can use it in class components with the context consumer component). but you're right, any function that ties into the component lifecycle involves hidden state.