In React what’s the best approach to pass around an instantiated class that provides access to backend data functions (eg getXX, createXx). In terms of:
A) singleton B) react context
Does React Context provide some benefit? If using React Context where would you instantiate the class and add it to the Context?
Note: was intending to define data access class as an interface, then could have Dev and Prod implementations I could manually swap in/out.