You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The fact that channel data can be either ChannelData or ChannelResponse can be quite inconvenient since then it's not clear to typescript whether given property can exist on the data object or not and it can result in properties being typed as unknown. So in a code like:
The fact that channel data can be either
ChannelData
orChannelResponse
can be quite inconvenient since then it's not clear to typescript whether given property can exist on thedata
object or not and it can result in properties being typed asunknown
. So in a code like:there will be an error like the one below when trying to access
created_by
property:There is probably a good reason for the type to be either but it's not working very well when trying to access data properties.
There could perhaps exist another method that returns data of the type
ChannelResponse
. Even if it's the same data but just type-casted.I know that I could type cast or similar to work around that but it's not ideal...
This is the relevant code in stream-chat:
stream-chat-js/src/channel.ts
Line 66 in b7936ed
The text was updated successfully, but these errors were encountered: