I see all of the following forms:
createContext()createContext(null)createContext({})createContext(theme: 'light', toggleTheme: () => {})
example of #4 is here. So can you just use #1 or #2 above and they are the same as #3 or #4?
#4 above seem like it has an empty function that somehow miraculously becomes something else? (because empty function. is not useful and supposedly it should do something). I sometimes see a
createContext(isFooBar: false, setIsFooBar: () => {})
as if somehow the setIsFooBar() will become a function that can alter the flag isFooBar. How does it really work?