> Save the global components off as global variables and just use them ... When my ActivityIndicator component mounts, it saves itself off to a global. Any code can import busy and run busy.start() and busy.stop(). What is the story that FP folks need to tell here, so that people don't do things like this?
Nothing. We know it's messy, but React doesn't really provide a better way of doing this. Context is barely mentioned in the docs, "not recommended" by the devs. Redux is incredibly verbose and overcomplicated. Passing "global" things down in props is just madness (if everything needs it). Personally I use context, or a singleton (which is just a hidden global really). It's naughty, but usually required for one or tw…
A lot of my code has to be mounted in separate root components and it's not allowed to be a SPA.
In this instance, it was convenient to use event listeners, though it's very similar to calling a global.