I'm trying to call isLeader and getTabId on the first render. This results in the below runtime exception:
Uncaught Error: ❌ Cross Tab feature is not enabled. To enable it set the "crossTab" property to true.
Affected Module
Version: 5.4.2
Describe the bug
Seems like the tab manager is instantiated in an effect. This means those functions (like isLeader or getTabId) that have the following check won't be callable except at certain times:
if (!manager.current) {
throw new Error('❌ Cross Tab feature is not enabled. To enable it set the "crossTab" property to true.')
}
Either the error message is deceiving or the behavior is unexpected.
To Reproduce
Steps to reproduce the behavior:
Go to '...'
Click on '....'
Scroll down to '....'
See error.
Expected behavior
Etiher:
1) the error message should reflect reality since one can get the exception even with crossTab: true.
2) or the functions in question should reflect the "not initialized state" in their return value instead of throwing. Throwing should happen only if crossTab is really set to false.
3) or this initialization should not happen in an effect, if that's feasible.
Either way this should probably be documented.
Screenshots
N/A
System Information (please complete the following information)
Bug information
I'm trying to call
isLeader
andgetTabId
on the first render. This results in the below runtime exception:Affected Module
Version
:5.4.2
Describe the bug
Seems like the tab manager is instantiated in an effect. This means those functions (like
isLeader
orgetTabId
) that have the following check won't be callable except at certain times:Either the error message is deceiving or the behavior is unexpected.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Etiher: 1) the error message should reflect reality since one can get the exception even with
crossTab: true
. 2) or the functions in question should reflect the "not initialized state" in their return value instead of throwing. Throwing should happen only ifcrossTab
is really set tofalse
. 3) or this initialization should not happen in an effect, if that's feasible.Either way this should probably be documented.
Screenshots
N/A
System Information (please complete the following information)
OS
: irrelevantDevice
: irrelevantBrowser Vendor
: irrelevantBrowser Version
: irrelevantAdditional context
-