How to handle React context in a reliable way.