ably-js
ably-js copied to clipboard
Decide on how to handle unexpected channel options change (via `setOptions` for example) in react-hooks
See conversation in ChannelProvider
PR: https://github.com/ably/ably-js/pull/1620#discussion_r1492422954, and how it was initially done via hasOptionsChanged
function in useEffect
hook. This approach had a lot of corner cases and was duplicating existing private code from RealtimeChannel._shouldReattachToSetOptions
method.
Ideally we should somehow detect if the user of react-hooks calls channel.setOptions
manually and notify him that this is not supported for react-hooks and would cause problems. Changing channel options should be done via ChannelProvider
.
┆Issue is synchronized with this Jira Story by Unito