Skip to content

Commit 02fb202

Browse files
authored
[CLNP-6835] Fix rules of hook violation (#1339)
[fix]: Fix rules of hook violation Channel 컴포넌트의 Rules of React hook violation에 대한 케이스를 해결하는 PR입니다. Fixes [CLNP-6835](https://sendbird.atlassian.net/browse/CLNP-6835) ### Changelogs - Fixed a bug that violates the rules of React hook in `Channel` component ### Checklist Put an `x` in the boxes that apply. You can also fill these out after creating the PR. If unsure, ask the members. This is a reminder of what we look for before merging your code. - [x] **All tests pass locally with my changes** - [ ] **I have added tests that prove my fix is effective or that my feature works** - [ ] **Public components / utils / props are appropriately exported** - [ ] I have added necessary documentation (if appropriate) ## External Contributions This project is not yet set up to accept pull requests from external contributors. If you have a pull request that you believe should be accepted, please contact the Developer Relations team <developer-advocates@sendbird.com> with details and we'll evaluate if we can set up a [CLA](https://en.wikipedia.org/wiki/Contributor_License_Agreement) to allow for the contribution. [CLNP-6835]: https://sendbird.atlassian.net/browse/CLNP-6835?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
1 parent f764163 commit 02fb202

File tree

9 files changed

+93
-32
lines changed

9 files changed

+93
-32
lines changed

src/modules/Channel/context/ChannelProvider.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ import { useHandleChannelPubsubEvents } from './hooks/useHandleChannelPubsubEven
5151
import { PublishingModuleType } from '../../internalInterfaces';
5252
import { ChannelActionTypes } from './dux/actionTypes';
5353
import useSendbird from '../../../lib/Sendbird/context/hooks/useSendbird';
54+
import { useLocalization } from '../../../lib/LocalizationContext';
5455

5556
export { ThreadReplySelectType } from './const'; // export for external usage
5657

@@ -228,7 +229,8 @@ const ChannelProvider = (props: ChannelContextProps) => {
228229
const [quoteMessage, setQuoteMessage] = useState<SendableMessageType | null>(null);
229230
const [isScrolled, setIsScrolled] = useState(false);
230231

231-
const [messagesStore, messagesDispatcher] = useReducer(messagesReducer, messagesInitialState);
232+
const { stringSet } = useLocalization();
233+
const [messagesStore, messagesDispatcher] = useReducer(messagesReducer, { ...messagesInitialState, stringSet });
232234
const scrollRef = useRef<HTMLDivElement>(null);
233235

234236
const isMentionEnabled = groupChannel.enableMention;

0 commit comments

Comments
 (0)