stream-chat-react-native-core 4.7.1-beta.2 → 4.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/contexts/messageContext/MessageContext.js +2 -9
- package/lib/commonjs/contexts/messageContext/MessageContext.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/contexts/messageContext/MessageContext.js +2 -9
- package/lib/module/contexts/messageContext/MessageContext.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/package.json +1 -1
- package/src/contexts/__tests__/index.test.tsx +0 -5
- package/src/contexts/messageContext/MessageContext.tsx +0 -7
- package/src/version.json +1 -1
|
@@ -15,8 +15,6 @@ var _defaultBaseContextValue = require("../utils/defaultBaseContextValue");
|
|
|
15
15
|
|
|
16
16
|
var _getDisplayName = require("../utils/getDisplayName");
|
|
17
17
|
|
|
18
|
-
var _isTestEnvironment = require("../utils/isTestEnvironment");
|
|
19
|
-
|
|
20
18
|
var _this = this,
|
|
21
19
|
_jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/contexts/messageContext/MessageContext.tsx";
|
|
22
20
|
|
|
@@ -36,7 +34,7 @@ var MessageProvider = function MessageProvider(_ref) {
|
|
|
36
34
|
__self: _this,
|
|
37
35
|
__source: {
|
|
38
36
|
fileName: _jsxFileName,
|
|
39
|
-
lineNumber:
|
|
37
|
+
lineNumber: 119,
|
|
40
38
|
columnNumber: 3
|
|
41
39
|
}
|
|
42
40
|
}, children);
|
|
@@ -46,11 +44,6 @@ exports.MessageProvider = MessageProvider;
|
|
|
46
44
|
|
|
47
45
|
var useMessageContext = function useMessageContext() {
|
|
48
46
|
var contextValue = (0, _react.useContext)(MessageContext);
|
|
49
|
-
|
|
50
|
-
if (contextValue === _defaultBaseContextValue.DEFAULT_BASE_CONTEXT_VALUE && !(0, _isTestEnvironment.isTestEnvironment)()) {
|
|
51
|
-
throw new Error("The useMessageContext hook was called outside of the MessageContext provider. Make sure you have configured MessageList component correctly - https://getstream.io/chat/docs/sdk/reactnative/basics/hello_stream_chat/#message-list");
|
|
52
|
-
}
|
|
53
|
-
|
|
54
47
|
return contextValue;
|
|
55
48
|
};
|
|
56
49
|
|
|
@@ -63,7 +56,7 @@ var withMessageContext = function withMessageContext(Component) {
|
|
|
63
56
|
__self: _this,
|
|
64
57
|
__source: {
|
|
65
58
|
fileName: _jsxFileName,
|
|
66
|
-
lineNumber:
|
|
59
|
+
lineNumber: 150,
|
|
67
60
|
columnNumber: 12
|
|
68
61
|
}
|
|
69
62
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["MessageContext.tsx"],"names":["MessageContext","React","createContext","DEFAULT_BASE_CONTEXT_VALUE","MessageProvider","children","value","useMessageContext","contextValue","
|
|
1
|
+
{"version":3,"sources":["MessageContext.tsx"],"names":["MessageContext","React","createContext","DEFAULT_BASE_CONTEXT_VALUE","MessageProvider","children","value","useMessageContext","contextValue","withMessageContext","Component","WithMessageContextComponent","props","messageContext","displayName"],"mappings":";;;;;;;;;;;AAAA;;AAaA;;AAEA;;;;;;;;;AA2FO,IAAMA,cAAc,GAAGC,kBAAMC,aAAN,CAC5BC,mDAD4B,CAAvB;;;;AAIA,IAAMC,eAAe,GAAG,SAAlBA,eAAkB;AAAA,MAG7BC,QAH6B,QAG7BA,QAH6B;AAAA,MAI7BC,KAJ6B,QAI7BA,KAJ6B;AAAA,SAQ7B,gCAAC,cAAD,CAAgB,QAAhB;AAAyB,IAAA,KAAK,EAAEA,KAAhC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KACGD,QADH,CAR6B;AAAA,CAAxB;;;;AAaA,IAAME,iBAAiB,GAAG,SAApBA,iBAAoB,GAE1B;AACL,MAAMC,YAAY,GAAG,uBACnBR,cADmB,CAArB;AAIA,SAAOQ,YAAP;AACD,CARM;;;;AAeA,IAAMC,kBAAkB,GAAG,SAArBA,kBAAqB,CAIhCC,SAJgC,EAKqC;AACrE,MAAMC,2BAA2B,GAAG,SAA9BA,2BAA8B,CAClCC,KADkC,EAE/B;AACH,QAAMC,cAAc,GAAGN,iBAAiB,EAAxC;AAEA,WAAO,gCAAC,SAAD,gCAAgBK,KAAhB,EAAiCC,cAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAAP;AACD,GAND;;AAOAF,EAAAA,2BAA2B,CAACG,WAA5B,0BAA+D,oCAAeJ,SAAf,CAA/D;AACA,SAAOC,2BAAP;AACD,CAfM","sourcesContent":["import React, { PropsWithChildren, useContext } from 'react';\n\nimport type { Attachment } from 'stream-chat';\n\nimport type { ActionHandler } from '../../components/Attachment/Attachment';\nimport type {\n MessageTouchableHandlerPayload,\n TouchableHandlerPayload,\n} from '../../components/Message/Message';\nimport type { GroupType, MessageType } from '../../components/MessageList/hooks/useMessageList';\nimport type { ChannelContextValue } from '../../contexts/channelContext/ChannelContext';\nimport type { MessageContentType } from '../../contexts/messagesContext/MessagesContext';\nimport type { DefaultStreamChatGenerics, UnknownType } from '../../types/types';\nimport { DEFAULT_BASE_CONTEXT_VALUE } from '../utils/defaultBaseContextValue';\n\nimport { getDisplayName } from '../utils/getDisplayName';\n\nexport type Alignment = 'right' | 'left';\n\nexport type Reactions = {\n own: boolean;\n type: string;\n}[];\n\nexport type MessageContextValue<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n /** Whether or not actions can be performed on message */\n actionsEnabled: boolean;\n /** Position of the message, either 'right' or 'left' */\n alignment: Alignment;\n /** The files attached to a message */\n files: Attachment<StreamChatGenerics>[];\n /**\n * Position of message in group - top, bottom, middle, single.\n *\n * Message group is a group of consecutive messages from same user. groupStyles can be used to style message as per their position in message group\n * e.g., user avatar (to which message belongs to) is only showed for last (bottom) message in group.\n */\n groupStyles: GroupType[];\n /** Handler for actions. Actions in combination with attachments can be used to build [commands](https://getstream.io/chat/docs/#channel_commands). */\n handleAction: ActionHandler;\n handleDeleteMessage: () => Promise<void>;\n handleEditMessage: () => void;\n handleQuotedReplyMessage: () => void;\n handleResendMessage: () => Promise<void>;\n handleToggleBanUser: () => Promise<void>;\n handleToggleMuteUser: () => Promise<void>;\n handleToggleReaction: (reactionType: string) => Promise<void>;\n /** Whether or not message has reactions */\n hasReactions: boolean;\n /** The images attached to a message */\n images: Attachment<StreamChatGenerics>[];\n /** Whether or not this is the active user's message */\n isMyMessage: boolean;\n /** Whether or not this is the last message in a group of messages */\n lastGroupMessage: boolean;\n /** Current [message object](https://getstream.io/chat/docs/#message_format) */\n message: MessageType<StreamChatGenerics>;\n /** Order to render the message content */\n messageContentOrder: MessageContentType[];\n /**\n * You can call methods available on the Message\n * component such as handleEdit, handleDelete, handleAction etc.\n *\n * Source - [Message](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Message/Message.tsx)\n *\n * By default, we show the overlay with all the message actions on long press.\n *\n * @param payload Payload object for onLongPress event\n */\n onLongPress: (payload: TouchableHandlerPayload) => void;\n /** Whether the message is only text and the text is only emojis */\n onlyEmojis: boolean;\n /** Handler to open a thread on a message */\n onOpenThread: () => void;\n /**\n * You can call methods available on the Message\n * component such as handleEdit, handleDelete, handleAction etc.\n *\n * Source - [Message](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Message/Message.tsx)\n *\n * By default, we will dismiss the keyboard on press.\n *\n * @param payload Payload object for onPress event\n */\n onPress: (payload: MessageTouchableHandlerPayload) => void;\n onPressIn: ((payload: TouchableHandlerPayload) => void) | null;\n /** The images attached to a message */\n otherAttachments: Attachment<StreamChatGenerics>[];\n reactions: Reactions;\n showMessageOverlay: (messageReactions?: boolean) => void;\n showMessageStatus: boolean;\n /** Whether or not the Message is part of a Thread */\n threadList: boolean;\n /** The videos attached to a message */\n videos: Attachment<StreamChatGenerics>[];\n goToMessage?: (messageId: string) => void;\n /** Latest message id on current channel */\n lastReceivedId?: string;\n /** Prevent message being pressed for image viewer view */\n preventPress?: boolean;\n /** Whether or not the avatar show show next to Message */\n showAvatar?: boolean;\n} & Pick<ChannelContextValue<StreamChatGenerics>, 'channel' | 'disabled' | 'members'>;\n\nexport const MessageContext = React.createContext(\n DEFAULT_BASE_CONTEXT_VALUE as MessageContextValue,\n);\n\nexport const MessageProvider = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n children,\n value,\n}: PropsWithChildren<{\n value?: MessageContextValue<StreamChatGenerics>;\n}>) => (\n <MessageContext.Provider value={value as unknown as MessageContextValue}>\n {children}\n </MessageContext.Provider>\n);\n\nexport const useMessageContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>() => {\n const contextValue = useContext(\n MessageContext,\n ) as unknown as MessageContextValue<StreamChatGenerics>;\n\n return contextValue;\n};\n\n/**\n * Typescript currently does not support partial inference so if MessageContext\n * typing is desired while using the HOC withMessageContextContext the Props for the\n * wrapped component must be provided as the first generic.\n */\nexport const withMessageContext = <\n P extends UnknownType,\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n Component: React.ComponentType<P>,\n): React.FC<Omit<P, keyof MessageContextValue<StreamChatGenerics>>> => {\n const WithMessageContextComponent = (\n props: Omit<P, keyof MessageContextValue<StreamChatGenerics>>,\n ) => {\n const messageContext = useMessageContext<StreamChatGenerics>();\n\n return <Component {...(props as P)} {...messageContext} />;\n };\n WithMessageContextComponent.displayName = `WithMessageContext${getDisplayName(Component)}`;\n return WithMessageContextComponent;\n};\n"]}
|
|
@@ -15,8 +15,6 @@ var _defaultBaseContextValue = require("../utils/defaultBaseContextValue");
|
|
|
15
15
|
|
|
16
16
|
var _getDisplayName = require("../utils/getDisplayName");
|
|
17
17
|
|
|
18
|
-
var _isTestEnvironment = require("../utils/isTestEnvironment");
|
|
19
|
-
|
|
20
18
|
var _this = this,
|
|
21
19
|
_jsxFileName = "/home/runner/work/stream-chat-react-native/stream-chat-react-native/package/src/contexts/messageContext/MessageContext.tsx";
|
|
22
20
|
|
|
@@ -36,7 +34,7 @@ var MessageProvider = function MessageProvider(_ref) {
|
|
|
36
34
|
__self: _this,
|
|
37
35
|
__source: {
|
|
38
36
|
fileName: _jsxFileName,
|
|
39
|
-
lineNumber:
|
|
37
|
+
lineNumber: 119,
|
|
40
38
|
columnNumber: 3
|
|
41
39
|
}
|
|
42
40
|
}, children);
|
|
@@ -46,11 +44,6 @@ exports.MessageProvider = MessageProvider;
|
|
|
46
44
|
|
|
47
45
|
var useMessageContext = function useMessageContext() {
|
|
48
46
|
var contextValue = (0, _react.useContext)(MessageContext);
|
|
49
|
-
|
|
50
|
-
if (contextValue === _defaultBaseContextValue.DEFAULT_BASE_CONTEXT_VALUE && !(0, _isTestEnvironment.isTestEnvironment)()) {
|
|
51
|
-
throw new Error("The useMessageContext hook was called outside of the MessageContext provider. Make sure you have configured MessageList component correctly - https://getstream.io/chat/docs/sdk/reactnative/basics/hello_stream_chat/#message-list");
|
|
52
|
-
}
|
|
53
|
-
|
|
54
47
|
return contextValue;
|
|
55
48
|
};
|
|
56
49
|
|
|
@@ -63,7 +56,7 @@ var withMessageContext = function withMessageContext(Component) {
|
|
|
63
56
|
__self: _this,
|
|
64
57
|
__source: {
|
|
65
58
|
fileName: _jsxFileName,
|
|
66
|
-
lineNumber:
|
|
59
|
+
lineNumber: 150,
|
|
67
60
|
columnNumber: 12
|
|
68
61
|
}
|
|
69
62
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["MessageContext.tsx"],"names":["MessageContext","React","createContext","DEFAULT_BASE_CONTEXT_VALUE","MessageProvider","children","value","useMessageContext","contextValue","
|
|
1
|
+
{"version":3,"sources":["MessageContext.tsx"],"names":["MessageContext","React","createContext","DEFAULT_BASE_CONTEXT_VALUE","MessageProvider","children","value","useMessageContext","contextValue","withMessageContext","Component","WithMessageContextComponent","props","messageContext","displayName"],"mappings":";;;;;;;;;;;AAAA;;AAaA;;AAEA;;;;;;;;;AA2FO,IAAMA,cAAc,GAAGC,kBAAMC,aAAN,CAC5BC,mDAD4B,CAAvB;;;;AAIA,IAAMC,eAAe,GAAG,SAAlBA,eAAkB;AAAA,MAG7BC,QAH6B,QAG7BA,QAH6B;AAAA,MAI7BC,KAJ6B,QAI7BA,KAJ6B;AAAA,SAQ7B,gCAAC,cAAD,CAAgB,QAAhB;AAAyB,IAAA,KAAK,EAAEA,KAAhC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KACGD,QADH,CAR6B;AAAA,CAAxB;;;;AAaA,IAAME,iBAAiB,GAAG,SAApBA,iBAAoB,GAE1B;AACL,MAAMC,YAAY,GAAG,uBACnBR,cADmB,CAArB;AAIA,SAAOQ,YAAP;AACD,CARM;;;;AAeA,IAAMC,kBAAkB,GAAG,SAArBA,kBAAqB,CAIhCC,SAJgC,EAKqC;AACrE,MAAMC,2BAA2B,GAAG,SAA9BA,2BAA8B,CAClCC,KADkC,EAE/B;AACH,QAAMC,cAAc,GAAGN,iBAAiB,EAAxC;AAEA,WAAO,gCAAC,SAAD,gCAAgBK,KAAhB,EAAiCC,cAAjC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OAAP;AACD,GAND;;AAOAF,EAAAA,2BAA2B,CAACG,WAA5B,0BAA+D,oCAAeJ,SAAf,CAA/D;AACA,SAAOC,2BAAP;AACD,CAfM","sourcesContent":["import React, { PropsWithChildren, useContext } from 'react';\n\nimport type { Attachment } from 'stream-chat';\n\nimport type { ActionHandler } from '../../components/Attachment/Attachment';\nimport type {\n MessageTouchableHandlerPayload,\n TouchableHandlerPayload,\n} from '../../components/Message/Message';\nimport type { GroupType, MessageType } from '../../components/MessageList/hooks/useMessageList';\nimport type { ChannelContextValue } from '../../contexts/channelContext/ChannelContext';\nimport type { MessageContentType } from '../../contexts/messagesContext/MessagesContext';\nimport type { DefaultStreamChatGenerics, UnknownType } from '../../types/types';\nimport { DEFAULT_BASE_CONTEXT_VALUE } from '../utils/defaultBaseContextValue';\n\nimport { getDisplayName } from '../utils/getDisplayName';\n\nexport type Alignment = 'right' | 'left';\n\nexport type Reactions = {\n own: boolean;\n type: string;\n}[];\n\nexport type MessageContextValue<\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n> = {\n /** Whether or not actions can be performed on message */\n actionsEnabled: boolean;\n /** Position of the message, either 'right' or 'left' */\n alignment: Alignment;\n /** The files attached to a message */\n files: Attachment<StreamChatGenerics>[];\n /**\n * Position of message in group - top, bottom, middle, single.\n *\n * Message group is a group of consecutive messages from same user. groupStyles can be used to style message as per their position in message group\n * e.g., user avatar (to which message belongs to) is only showed for last (bottom) message in group.\n */\n groupStyles: GroupType[];\n /** Handler for actions. Actions in combination with attachments can be used to build [commands](https://getstream.io/chat/docs/#channel_commands). */\n handleAction: ActionHandler;\n handleDeleteMessage: () => Promise<void>;\n handleEditMessage: () => void;\n handleQuotedReplyMessage: () => void;\n handleResendMessage: () => Promise<void>;\n handleToggleBanUser: () => Promise<void>;\n handleToggleMuteUser: () => Promise<void>;\n handleToggleReaction: (reactionType: string) => Promise<void>;\n /** Whether or not message has reactions */\n hasReactions: boolean;\n /** The images attached to a message */\n images: Attachment<StreamChatGenerics>[];\n /** Whether or not this is the active user's message */\n isMyMessage: boolean;\n /** Whether or not this is the last message in a group of messages */\n lastGroupMessage: boolean;\n /** Current [message object](https://getstream.io/chat/docs/#message_format) */\n message: MessageType<StreamChatGenerics>;\n /** Order to render the message content */\n messageContentOrder: MessageContentType[];\n /**\n * You can call methods available on the Message\n * component such as handleEdit, handleDelete, handleAction etc.\n *\n * Source - [Message](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Message/Message.tsx)\n *\n * By default, we show the overlay with all the message actions on long press.\n *\n * @param payload Payload object for onLongPress event\n */\n onLongPress: (payload: TouchableHandlerPayload) => void;\n /** Whether the message is only text and the text is only emojis */\n onlyEmojis: boolean;\n /** Handler to open a thread on a message */\n onOpenThread: () => void;\n /**\n * You can call methods available on the Message\n * component such as handleEdit, handleDelete, handleAction etc.\n *\n * Source - [Message](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/Message/Message.tsx)\n *\n * By default, we will dismiss the keyboard on press.\n *\n * @param payload Payload object for onPress event\n */\n onPress: (payload: MessageTouchableHandlerPayload) => void;\n onPressIn: ((payload: TouchableHandlerPayload) => void) | null;\n /** The images attached to a message */\n otherAttachments: Attachment<StreamChatGenerics>[];\n reactions: Reactions;\n showMessageOverlay: (messageReactions?: boolean) => void;\n showMessageStatus: boolean;\n /** Whether or not the Message is part of a Thread */\n threadList: boolean;\n /** The videos attached to a message */\n videos: Attachment<StreamChatGenerics>[];\n goToMessage?: (messageId: string) => void;\n /** Latest message id on current channel */\n lastReceivedId?: string;\n /** Prevent message being pressed for image viewer view */\n preventPress?: boolean;\n /** Whether or not the avatar show show next to Message */\n showAvatar?: boolean;\n} & Pick<ChannelContextValue<StreamChatGenerics>, 'channel' | 'disabled' | 'members'>;\n\nexport const MessageContext = React.createContext(\n DEFAULT_BASE_CONTEXT_VALUE as MessageContextValue,\n);\n\nexport const MessageProvider = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>({\n children,\n value,\n}: PropsWithChildren<{\n value?: MessageContextValue<StreamChatGenerics>;\n}>) => (\n <MessageContext.Provider value={value as unknown as MessageContextValue}>\n {children}\n </MessageContext.Provider>\n);\n\nexport const useMessageContext = <\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>() => {\n const contextValue = useContext(\n MessageContext,\n ) as unknown as MessageContextValue<StreamChatGenerics>;\n\n return contextValue;\n};\n\n/**\n * Typescript currently does not support partial inference so if MessageContext\n * typing is desired while using the HOC withMessageContextContext the Props for the\n * wrapped component must be provided as the first generic.\n */\nexport const withMessageContext = <\n P extends UnknownType,\n StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics,\n>(\n Component: React.ComponentType<P>,\n): React.FC<Omit<P, keyof MessageContextValue<StreamChatGenerics>>> => {\n const WithMessageContextComponent = (\n props: Omit<P, keyof MessageContextValue<StreamChatGenerics>>,\n ) => {\n const messageContext = useMessageContext<StreamChatGenerics>();\n\n return <Component {...(props as P)} {...messageContext} />;\n };\n WithMessageContextComponent.displayName = `WithMessageContext${getDisplayName(Component)}`;\n return WithMessageContextComponent;\n};\n"]}
|
package/lib/module/version.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stream-chat-react-native-core",
|
|
3
3
|
"description": "The official React Native and Expo components for Stream Chat, a service for building chat applications",
|
|
4
|
-
"version": "4.7.
|
|
4
|
+
"version": "4.7.2",
|
|
5
5
|
"author": {
|
|
6
6
|
"company": "Stream.io Inc",
|
|
7
7
|
"name": "Stream.io Inc"
|
|
@@ -9,7 +9,6 @@ import {
|
|
|
9
9
|
useChannelsContext,
|
|
10
10
|
useChatContext,
|
|
11
11
|
useImageGalleryContext,
|
|
12
|
-
useMessageContext,
|
|
13
12
|
useMessageOverlayContext,
|
|
14
13
|
useMessagesContext,
|
|
15
14
|
useOverlayContext,
|
|
@@ -75,10 +74,6 @@ describe('contexts hooks in a component throws an error with message when not wr
|
|
|
75
74
|
useImageGalleryContext,
|
|
76
75
|
`The useImageGalleryContext hook was called outside the ImageGalleryContext Provider. Make sure you have configured OverlayProvider component correctly - https://getstream.io/chat/docs/sdk/reactnative/basics/hello_stream_chat/#overlay-provider`,
|
|
77
76
|
],
|
|
78
|
-
[
|
|
79
|
-
useMessageContext,
|
|
80
|
-
`The useMessageContext hook was called outside of the MessageContext provider. Make sure you have configured MessageList component correctly - https://getstream.io/chat/docs/sdk/reactnative/basics/hello_stream_chat/#message-list`,
|
|
81
|
-
],
|
|
82
77
|
[
|
|
83
78
|
useMessageOverlayContext,
|
|
84
79
|
`The useMessageOverlayContext hook was called outside the MessageOverlayContext Provider. Make sure you have configured OverlayProvider component correctly - https://getstream.io/chat/docs/sdk/reactnative/basics/hello_stream_chat/#overlay-provider`,
|
|
@@ -14,7 +14,6 @@ import type { DefaultStreamChatGenerics, UnknownType } from '../../types/types';
|
|
|
14
14
|
import { DEFAULT_BASE_CONTEXT_VALUE } from '../utils/defaultBaseContextValue';
|
|
15
15
|
|
|
16
16
|
import { getDisplayName } from '../utils/getDisplayName';
|
|
17
|
-
import { isTestEnvironment } from '../utils/isTestEnvironment';
|
|
18
17
|
|
|
19
18
|
export type Alignment = 'right' | 'left';
|
|
20
19
|
|
|
@@ -129,12 +128,6 @@ export const useMessageContext = <
|
|
|
129
128
|
MessageContext,
|
|
130
129
|
) as unknown as MessageContextValue<StreamChatGenerics>;
|
|
131
130
|
|
|
132
|
-
if (contextValue === DEFAULT_BASE_CONTEXT_VALUE && !isTestEnvironment()) {
|
|
133
|
-
throw new Error(
|
|
134
|
-
`The useMessageContext hook was called outside of the MessageContext provider. Make sure you have configured MessageList component correctly - https://getstream.io/chat/docs/sdk/reactnative/basics/hello_stream_chat/#message-list`,
|
|
135
|
-
);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
131
|
return contextValue;
|
|
139
132
|
};
|
|
140
133
|
|
package/src/version.json
CHANGED