Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use
useLayoutEffect
when calling .setOptions()
in ChannelProvider
This is a temporary fix for #1704. This does not fix the underlying problem of ably-js sending two `ATTACH` messages with the same options when we call `.setOptions()` in `ChannelProvider`. What `useLayoutEffect` accomplishes is it runs before children components' `useEffect` hooks, thus it sets options for a channel before attachment process starts, so there will be no need for reattachment and sending a second `ATTACH` message.
- Loading branch information