Comment by throwaway17_17

Comment by throwaway17_17 10 hours ago

0 replies

I think (and I’m not a Zig user at anything above a hobbyist level) based on what the developers have discussed publically:

React has a ‘roughly’ functional slant to the way it does things and so needs to provide a special case ‘hook’ for a certain type of context object. Zig however is an imperative language that allows for global state (and mutable global state for that matter), which means that there is always a way to access global variable, no hook required. On the other hand, I am relatively certain (almost 100% to be honest) there can not be a context/IO , or any data/variable, passed into a function higher up the call stack and have that propagate to the lower level via implicit inclusion.