stream-chat-react-native-core 5.4.3-beta.1 → 5.4.3
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/i18n/tr.json +19 -19
- package/lib/commonjs/version.json +1 -1
- package/lib/module/i18n/tr.json +19 -19
- package/lib/module/version.json +1 -1
- package/lib/typescript/i18n/tr.json +19 -19
- package/package.json +1 -1
- package/src/i18n/tr.json +19 -19
- package/src/version.json +1 -1
- package/lib/commonjs/components/Channel/Channel.md +0 -39
- package/lib/commonjs/components/ChannelList/ChannelList.md +0 -18
- package/lib/commonjs/components/ChannelList/ChannelListMessenger.md +0 -19
- package/lib/commonjs/components/Message/Message.md +0 -22
- package/lib/commonjs/components/Message/MessageSimple/MessageText.md +0 -4
- package/lib/commonjs/components/Message/MessageSimple/utils/renderText.md +0 -11
- package/lib/commonjs/components/docs/AttachmentProps.md +0 -1
- package/lib/commonjs/components/docs/ListProps.md +0 -14
- package/lib/commonjs/components/docs/MessageProps.md +0 -1
- package/lib/commonjs/components/docs/PreviewProps.md +0 -7
- package/lib/commonjs/contexts/channelContext/ChannelContext.md +0 -37
- package/lib/commonjs/contexts/channelsContext/ChannelsContext.md +0 -38
- package/lib/commonjs/contexts/chatContext/ChatContext.md +0 -37
- package/lib/commonjs/contexts/imageGalleryContext/ImageGalleryContext.md +0 -38
- package/lib/commonjs/contexts/keyboardContext/KeyboardContext.md +0 -5
- package/lib/commonjs/contexts/keyboardContext/withKeyboardContext.md +0 -18
- package/lib/commonjs/contexts/messageContext/MessageContext.md +0 -43
- package/lib/commonjs/contexts/messageInputContext/MessageInputContext.md +0 -40
- package/lib/commonjs/contexts/messagesContext/MessagesContext.md +0 -35
- package/lib/commonjs/contexts/messagesContext/withMessagesContext.md +0 -26
- package/lib/commonjs/contexts/overlayContext/OverlayContext.md +0 -34
- package/lib/commonjs/contexts/overlayContext/OverlayProvider.md +0 -0
- package/lib/commonjs/contexts/overlayContext/withOverlayContext.md +0 -1
- package/lib/commonjs/contexts/paginatedMessageListContext/PaginatedMessageListContext.md +0 -34
- package/lib/commonjs/contexts/suggestionsContext/SuggestionsContext.md +0 -28
- package/lib/commonjs/contexts/suggestionsContext/withSuggestionsContext.md +0 -1
- package/lib/commonjs/contexts/threadContext/ThreadContext.md +0 -34
- package/lib/commonjs/contexts/typingContext/TypingContext.md +0 -33
- package/lib/commonjs/utils/Streami18n.md +0 -390
- package/lib/module/components/Channel/Channel.md +0 -39
- package/lib/module/components/ChannelList/ChannelList.md +0 -18
- package/lib/module/components/ChannelList/ChannelListMessenger.md +0 -19
- package/lib/module/components/Message/Message.md +0 -22
- package/lib/module/components/Message/MessageSimple/MessageText.md +0 -4
- package/lib/module/components/Message/MessageSimple/utils/renderText.md +0 -11
- package/lib/module/components/docs/AttachmentProps.md +0 -1
- package/lib/module/components/docs/ListProps.md +0 -14
- package/lib/module/components/docs/MessageProps.md +0 -1
- package/lib/module/components/docs/PreviewProps.md +0 -7
- package/lib/module/contexts/channelContext/ChannelContext.md +0 -37
- package/lib/module/contexts/channelsContext/ChannelsContext.md +0 -38
- package/lib/module/contexts/chatContext/ChatContext.md +0 -37
- package/lib/module/contexts/imageGalleryContext/ImageGalleryContext.md +0 -38
- package/lib/module/contexts/keyboardContext/KeyboardContext.md +0 -5
- package/lib/module/contexts/keyboardContext/withKeyboardContext.md +0 -18
- package/lib/module/contexts/messageContext/MessageContext.md +0 -43
- package/lib/module/contexts/messageInputContext/MessageInputContext.md +0 -40
- package/lib/module/contexts/messagesContext/MessagesContext.md +0 -35
- package/lib/module/contexts/messagesContext/withMessagesContext.md +0 -26
- package/lib/module/contexts/overlayContext/OverlayContext.md +0 -34
- package/lib/module/contexts/overlayContext/OverlayProvider.md +0 -0
- package/lib/module/contexts/overlayContext/withOverlayContext.md +0 -1
- package/lib/module/contexts/paginatedMessageListContext/PaginatedMessageListContext.md +0 -34
- package/lib/module/contexts/suggestionsContext/SuggestionsContext.md +0 -28
- package/lib/module/contexts/suggestionsContext/withSuggestionsContext.md +0 -1
- package/lib/module/contexts/threadContext/ThreadContext.md +0 -34
- package/lib/module/contexts/typingContext/TypingContext.md +0 -33
- package/lib/module/utils/Streami18n.md +0 -390
- package/src/components/Channel/Channel.md +0 -39
- package/src/components/ChannelList/ChannelList.md +0 -18
- package/src/components/ChannelList/ChannelListMessenger.md +0 -19
- package/src/components/Message/Message.md +0 -22
- package/src/components/Message/MessageSimple/MessageText.md +0 -4
- package/src/components/Message/MessageSimple/utils/renderText.md +0 -11
- package/src/components/docs/AttachmentProps.md +0 -1
- package/src/components/docs/ListProps.md +0 -14
- package/src/components/docs/MessageProps.md +0 -1
- package/src/components/docs/PreviewProps.md +0 -7
- package/src/contexts/channelContext/ChannelContext.md +0 -37
- package/src/contexts/channelsContext/ChannelsContext.md +0 -38
- package/src/contexts/chatContext/ChatContext.md +0 -37
- package/src/contexts/imageGalleryContext/ImageGalleryContext.md +0 -38
- package/src/contexts/keyboardContext/KeyboardContext.md +0 -5
- package/src/contexts/keyboardContext/withKeyboardContext.md +0 -18
- package/src/contexts/messageContext/MessageContext.md +0 -43
- package/src/contexts/messageInputContext/MessageInputContext.md +0 -40
- package/src/contexts/messagesContext/MessagesContext.md +0 -35
- package/src/contexts/messagesContext/withMessagesContext.md +0 -26
- package/src/contexts/overlayContext/OverlayContext.md +0 -34
- package/src/contexts/overlayContext/OverlayProvider.md +0 -0
- package/src/contexts/overlayContext/withOverlayContext.md +0 -1
- package/src/contexts/paginatedMessageListContext/PaginatedMessageListContext.md +0 -34
- package/src/contexts/suggestionsContext/SuggestionsContext.md +0 -28
- package/src/contexts/suggestionsContext/withSuggestionsContext.md +0 -1
- package/src/contexts/threadContext/ThreadContext.md +0 -34
- package/src/contexts/typingContext/TypingContext.md +0 -33
- package/src/utils/Streami18n.md +0 -390
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
Please check the `ImageGalleryContextValue` in [ImageGalleryContext](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/contexts/imageGalleryContext/ImageGalleryContext.tsx), for consumable values.
|
|
2
|
-
Provider for this context exists in `OverlayProvider` component. And so, any child component of OverlayProvider
|
|
3
|
-
can get access to context as following:
|
|
4
|
-
|
|
5
|
-
- Functional component
|
|
6
|
-
|
|
7
|
-
```tsx static
|
|
8
|
-
import { useChannelsContext } from 'stream-chat-react-native';
|
|
9
|
-
|
|
10
|
-
const SomeChildComponent = () => {
|
|
11
|
-
const { selectedMessage, setSelectedMessage, setMessages } = useImageGalleryContext();
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<View />
|
|
15
|
-
)
|
|
16
|
-
}
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
- Class component
|
|
20
|
-
|
|
21
|
-
```tsx static
|
|
22
|
-
import React from 'react';
|
|
23
|
-
import { withChannelsContext } from 'stream-chat-react-native';
|
|
24
|
-
|
|
25
|
-
class SomeChildComponent extends React.Component {
|
|
26
|
-
constructor(props) {
|
|
27
|
-
super(props);
|
|
28
|
-
|
|
29
|
-
console.log(props.image);
|
|
30
|
-
console.log(props.setImage);
|
|
31
|
-
console.log(props.setImages);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// UI Logic
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
export withImageGalleryContext(SomeChildComponent);
|
|
38
|
-
```
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
When user focuses on input box, keyboard opens up on mobile devices. When keyboard opens, it is necessary to update the position of input box and height of content on screen
|
|
2
|
-
so that it doesn't get hidden behind keyboard. This is handled by [KeyboardCompatibleView](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/components/KeyboardCompatibleView/KeyboardCompatibleView.tsx) which
|
|
3
|
-
is a HOC. It creates a context which contain following function.
|
|
4
|
-
|
|
5
|
-
- **dismissKeyboard** Dismisses the keyboard and adjusts the height of content on screen.
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
Any component can be made a consumer of [KeyboardContext](#keyboardcontext) by using function `withKeyboardContext`.
|
|
2
|
-
|
|
3
|
-
e.g.,
|
|
4
|
-
|
|
5
|
-
```js static
|
|
6
|
-
import { Button } from 'react-native';
|
|
7
|
-
|
|
8
|
-
import { withKeyboardContext } from './KeyboardContext';
|
|
9
|
-
|
|
10
|
-
const DemoComponentWithKeyboardContext = withKeyboardContext(DemoComponent);
|
|
11
|
-
|
|
12
|
-
const DemoComponent = (props) => (
|
|
13
|
-
<Button
|
|
14
|
-
onPress={props.dismissKeyboard}
|
|
15
|
-
title='Button to dismiss keyboard'
|
|
16
|
-
/>
|
|
17
|
-
);
|
|
18
|
-
```
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
Please check the `MessageContextValue` in [MessageContext](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/contexts/messageContext/MessageContext.tsx), for consumable values.
|
|
2
|
-
Provider for this context exists in `Message` component. And so, any child component of `Message`
|
|
3
|
-
can get access to context as following:
|
|
4
|
-
|
|
5
|
-
- Functional component
|
|
6
|
-
|
|
7
|
-
```tsx static
|
|
8
|
-
import { useMessageContext } from 'stream-chat-react-native';
|
|
9
|
-
|
|
10
|
-
const SomeChildComponent = () => {
|
|
11
|
-
const {
|
|
12
|
-
handleDeleteMessage,
|
|
13
|
-
handleEditMessage,
|
|
14
|
-
handleQuotedReplyMessage,
|
|
15
|
-
handleResendMessage,
|
|
16
|
-
handleToggleBanUser,
|
|
17
|
-
handleToggleMuteUser,
|
|
18
|
-
handleToggleReaction,
|
|
19
|
-
} = useMessageContext();
|
|
20
|
-
|
|
21
|
-
return (
|
|
22
|
-
<View />
|
|
23
|
-
)
|
|
24
|
-
}
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
- Class component
|
|
28
|
-
|
|
29
|
-
```tsx static
|
|
30
|
-
import React from 'react';
|
|
31
|
-
import { withMessageContext } from 'stream-chat-react-native';
|
|
32
|
-
|
|
33
|
-
class SomeChildComponent extends React.Component {
|
|
34
|
-
constructor(props) {
|
|
35
|
-
super(props);
|
|
36
|
-
|
|
37
|
-
console.log(props.handleDeleteMessage);
|
|
38
|
-
console.log(props.handleEditMessage);
|
|
39
|
-
console.log(props.handleToggleReaction);
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
// UI Logic
|
|
43
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
Please check the `MessageInputContextValue` in [MessageInputContext](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/contexts/messageInputContext/MessageInputContext.tsx), for consumable values.
|
|
2
|
-
Provider for this context exists in `Channel` component. And so, any child component of `Channel`
|
|
3
|
-
can get access to context as following:
|
|
4
|
-
|
|
5
|
-
- Functional component
|
|
6
|
-
|
|
7
|
-
```tsx static
|
|
8
|
-
import { useMessageInputContext } from 'stream-chat-react-native';
|
|
9
|
-
|
|
10
|
-
const SomeChildComponent = () => {
|
|
11
|
-
const {
|
|
12
|
-
openAttachmentPicker,
|
|
13
|
-
openCommandsPicker,
|
|
14
|
-
openFilePicker,
|
|
15
|
-
openMentionsPicker,
|
|
16
|
-
} = useMessageInputContext();
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<View />
|
|
20
|
-
)
|
|
21
|
-
}
|
|
22
|
-
```
|
|
23
|
-
|
|
24
|
-
- Class component
|
|
25
|
-
|
|
26
|
-
```tsx static
|
|
27
|
-
import React from 'react';
|
|
28
|
-
import { withMessageInputContext } from 'stream-chat-react-native';
|
|
29
|
-
|
|
30
|
-
class SomeChildComponent extends React.Component {
|
|
31
|
-
constructor(props) {
|
|
32
|
-
super(props);
|
|
33
|
-
|
|
34
|
-
console.log(props.openAttachmentPicker);
|
|
35
|
-
console.log(props.openCommandsPicker);
|
|
36
|
-
console.log(props.openFilePicker);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
// UI Logic
|
|
40
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
Please check the `MessagesContextValue` in [MessagesContext](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/contexts/messageContext/MessageContext.tsx), for consumable values.
|
|
2
|
-
Provider for this context exists in `Channel` component. And so, any child component of Channel
|
|
3
|
-
can get access to context as following:
|
|
4
|
-
|
|
5
|
-
- Functional component
|
|
6
|
-
|
|
7
|
-
```tsx static
|
|
8
|
-
import { useMessagesContext } from 'stream-chat-react-native';
|
|
9
|
-
|
|
10
|
-
const SomeChildComponent = () => {
|
|
11
|
-
const { handleDelete, handleRetry } = useMessagesContext();
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<View />
|
|
15
|
-
)
|
|
16
|
-
}
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
- Class component
|
|
20
|
-
|
|
21
|
-
```tsx static
|
|
22
|
-
import React from 'react';
|
|
23
|
-
import { withMessagesContext } from 'stream-chat-react-native';
|
|
24
|
-
|
|
25
|
-
class SomeChildComponent extends React.Component {
|
|
26
|
-
constructor(props) {
|
|
27
|
-
super(props);
|
|
28
|
-
|
|
29
|
-
console.log(props.handleDelete);
|
|
30
|
-
console.log(props.handleRetry);
|
|
31
|
-
console.log(props.refreshing);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// UI Logic
|
|
35
|
-
}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
Any component can consume the [MessagesContext](#messagescontext) and receive its values through props by using the higher order component `withMessagesContext`.
|
|
2
|
-
|
|
3
|
-
**Example:**
|
|
4
|
-
|
|
5
|
-
```js static
|
|
6
|
-
import { Text, View } from 'react-native';
|
|
7
|
-
|
|
8
|
-
import { withMessagesContext } from './MessagesContext';
|
|
9
|
-
|
|
10
|
-
const DemoComponentWithMessagesContext = withMessagesContext(DemoComponent);
|
|
11
|
-
|
|
12
|
-
const DemoComponent = (props) => {
|
|
13
|
-
const { loadingMore, messages } = props;
|
|
14
|
-
|
|
15
|
-
return (
|
|
16
|
-
<View>
|
|
17
|
-
<Text>
|
|
18
|
-
MessageList is currently loading more: {loadingMore}
|
|
19
|
-
</Text>
|
|
20
|
-
<Text>
|
|
21
|
-
Number of messages in demo component: {messages.length}
|
|
22
|
-
</Text>
|
|
23
|
-
</View>
|
|
24
|
-
);
|
|
25
|
-
};
|
|
26
|
-
```
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
Please check the `OverlayContextValue` in [OverlayContext](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/contexts/overlayContext/OverlayContext.tsx), for consumable values.
|
|
2
|
-
Provider for this context exists in `OverlayProvider` component. And so, any child component of OverlayProvider
|
|
3
|
-
can get access to context as following:
|
|
4
|
-
|
|
5
|
-
- Functional component
|
|
6
|
-
|
|
7
|
-
```tsx static
|
|
8
|
-
import { useOverlayContext } from 'stream-chat-react-native';
|
|
9
|
-
|
|
10
|
-
const SomeChildComponent = () => {
|
|
11
|
-
const { openPicker, closePicker } = useOverlayContext();
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<View />
|
|
15
|
-
)
|
|
16
|
-
}
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
- Class component
|
|
20
|
-
|
|
21
|
-
```tsx static
|
|
22
|
-
import React from 'react';
|
|
23
|
-
import { withOverlayContext } from 'stream-chat-react-native';
|
|
24
|
-
|
|
25
|
-
class SomeChildComponent extends React.Component {
|
|
26
|
-
constructor(props) {
|
|
27
|
-
super(props);
|
|
28
|
-
|
|
29
|
-
console.log(props.openPicker);
|
|
30
|
-
console.log(props.closePicker);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// UI Logic
|
|
34
|
-
}
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Any component can be made a consumer of the [OverlayContext](#overlaycontext) by using the `withOverlayContext` higher order component.
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
Please check the `PaginatedMessageListContextValue` in [PaginatedMessageListContext](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/contexts/paginatedMessageListContext/PaginatedMessageListContext.tsx), for consumable values.
|
|
2
|
-
Provider for this context exists in `Channel` component. And so, any child component of Channel
|
|
3
|
-
can get access to context as following:
|
|
4
|
-
|
|
5
|
-
- Functional component
|
|
6
|
-
|
|
7
|
-
```tsx static
|
|
8
|
-
import { usePaginatedMessageListContext } from 'stream-chat-react-native';
|
|
9
|
-
|
|
10
|
-
const SomeChildComponent = () => {
|
|
11
|
-
const { loadMore, loadingMore, loadMoreRecent, loadingMoreRecent } = usePaginatedMessageListContext();
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<View />
|
|
15
|
-
)
|
|
16
|
-
}
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
- Class component
|
|
20
|
-
|
|
21
|
-
```tsx static
|
|
22
|
-
import React from 'react';
|
|
23
|
-
import { withPaginatedMessageListContext } from 'stream-chat-react-native';
|
|
24
|
-
|
|
25
|
-
class SomeChildComponent extends React.Component {
|
|
26
|
-
constructor(props) {
|
|
27
|
-
super(props);
|
|
28
|
-
|
|
29
|
-
console.log(props.loadMore);
|
|
30
|
-
console.log(props.loadMoreRecent);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// UI Logic
|
|
34
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
The MessageInput component supports a suggestions feature. Suggestions are displayed using a popup which contains a list of the suggestion items. All functionality is saved in the SuggestionsContext and can be accessed through the [SuggestionsProvider](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/contexts/suggestionsContext/SuggestionsContext.tsx) higher order component. This HOC provides the following functions to its underlying child components:
|
|
2
|
-
|
|
3
|
-
- **closeSuggestions** {function} Closes the suggestions popup above the input box
|
|
4
|
-
- **openSuggestions** {function} Opens the suggestions popup above the input box
|
|
5
|
-
|
|
6
|
-
**Params:**
|
|
7
|
-
|
|
8
|
-
- **title:** Title for the suggestions popup
|
|
9
|
-
- **component:** UI component used to display each item in the suggestions list
|
|
10
|
-
- **setInputBoxContainerRef** {function} Sets a ref on the text input box container
|
|
11
|
-
- **updateSuggestions** {function} Updates the suggestions in the suggestions popup
|
|
12
|
-
|
|
13
|
-
**Params:**
|
|
14
|
-
|
|
15
|
-
- **suggestions:** Array of suggestion objects
|
|
16
|
-
|
|
17
|
-
**Example:**
|
|
18
|
-
|
|
19
|
-
```json
|
|
20
|
-
{
|
|
21
|
-
data: [
|
|
22
|
-
'suggestion 1',
|
|
23
|
-
'suggestion 2',
|
|
24
|
-
'suggestion 3',
|
|
25
|
-
],
|
|
26
|
-
onSelect: (suggestionItem) => { ... }
|
|
27
|
-
}
|
|
28
|
-
```
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Any component can be made a consumer of the [SuggestionsContext](#suggestionscontext) by using the `withSuggestionsContext` higher order component.
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
Please check the `ThreadContexttValue` in [ThreadContextt](), for consumable values.
|
|
2
|
-
Provider for this context exists in `Channel` component. And so, any child component of Channel
|
|
3
|
-
can get access to context as following:
|
|
4
|
-
|
|
5
|
-
- Functional component
|
|
6
|
-
|
|
7
|
-
```tsx static
|
|
8
|
-
import { useThreadContextt } from 'stream-chat-react-native';
|
|
9
|
-
|
|
10
|
-
const SomeChildComponent = () => {
|
|
11
|
-
const { openThread, threadMessages } = useThreadContextt();
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<View />
|
|
15
|
-
)
|
|
16
|
-
}
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
- Class component
|
|
20
|
-
|
|
21
|
-
```tsx static
|
|
22
|
-
import React from 'react';
|
|
23
|
-
import { withThreadContextt } from 'stream-chat-react-native';
|
|
24
|
-
|
|
25
|
-
class SomeChildComponent extends React.Component {
|
|
26
|
-
constructor(props) {
|
|
27
|
-
super(props);
|
|
28
|
-
|
|
29
|
-
console.log(props.openThread);
|
|
30
|
-
console.log(props.threadMessages);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// UI Logic
|
|
34
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
Please check the `TypingContextValue` in [TypingContext](https://github.com/GetStream/stream-chat-react-native/blob/main/package/src/contexts/TypingContext/TypingContext.tsx), for consumable values.
|
|
2
|
-
Provider for this context exists in `Channel` component. And so, any child component of Channel
|
|
3
|
-
can get access to context as following:
|
|
4
|
-
|
|
5
|
-
- Functional component
|
|
6
|
-
|
|
7
|
-
```tsx static
|
|
8
|
-
import { useTypingContext } from 'stream-chat-react-native';
|
|
9
|
-
|
|
10
|
-
const SomeChildComponent = () => {
|
|
11
|
-
const { typing } = useTypingContext();
|
|
12
|
-
|
|
13
|
-
return (
|
|
14
|
-
<View />
|
|
15
|
-
)
|
|
16
|
-
}
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
- Class component
|
|
20
|
-
|
|
21
|
-
```tsx static
|
|
22
|
-
import React from 'react';
|
|
23
|
-
import { withTypingContext } from 'stream-chat-react-native';
|
|
24
|
-
|
|
25
|
-
class SomeChildComponent extends React.Component {
|
|
26
|
-
constructor(props) {
|
|
27
|
-
super(props);
|
|
28
|
-
|
|
29
|
-
console.log(props.typing);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
// UI Logic
|
|
33
|
-
}
|