# Confusing error with React UIKit Channel Provider

**URL:** <https://community.sendbird.com/t/confusing-error-with-react-uikit-channel-provider/8504>\
**Category:** React\
**Created:** [October 27, 2023, 2:55am UTC](https://community.sendbird.com/t/confusing-error-with-react-uikit-channel-provider/8504 "2023-10-27T02:55:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andrew\_Bennett](https://sea2.discourse-cdn.com/flex020/user_avatar/community.sendbird.com/andrew_bennett/32/4651_2.png) [@Andrew\_Bennett](https://community.sendbird.com/u/Andrew_Bennett)\
**Post date:** [October 27, 2023, 2:55am UTC](https://community.sendbird.com/t/confusing-error-with-react-uikit-channel-provider/8504/1 "2023-10-27T02:55:27Z")

</div>

**[Problem/Question]**

**EDIT:** Reverting to version 3.6.0 resolved this issue.

I’m getting an error when using `sendUserMessage` from the `sendbirdSelectors.getSendUserMessage` selector inside of the `ChannelProvider` component.

Here is the error:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/sendbird/original/2X/7/76ab51cd88d10433e2da1c8fad00efb0dcd47d28.jpeg)

Here is a [Github repo link](https://github.com/bennettgh/sendbird-help) to a minimal reproduction of the error using a new create-react-app. Here is a snippet the same code at a glance.

```auto
function App() {
  return (
    <div className="App">
      <SendbirdProvider appId={APP_ID} userId={USER_ID} accessToken={ACCESS_TOKEN}>
        <ChannelProvider channelUrl={CHANNEL_URL}>
          <Chat />
        </ChannelProvider>
      </SendbirdProvider >
    </div>
  );
}

function Chat() {
  const globalStore = useSendbirdStateContext();
  const getGroupChannel = sendbirdSelectors.getGetGroupChannel(globalStore);
  const sendUserMessage = sendbirdSelectors.getSendUserMessage(globalStore);

  // error happens when `sendUserMessage` is called
  // interestingly, if ChannelProvider is removed, no error occurs 
  const handleClick = async () => {
    const groupChannel = await getGroupChannel(CHANNEL_URL)
    sendUserMessage(groupChannel, {
      message: "Hello World!"
    })
  }

  return (
    <button onClick={handleClick}>Click</button>
  );
}

```

* * *

**[UIKit Version]**  
3.7.0

**[Reproduction Steps]**

> **[GitHub - bennettgh/sendbird-help](https://github.com/bennettgh/sendbird-help/)**
>
> Contribute to bennettgh/sendbird-help development by creating an account on GitHub.

Thank you in advance for taking a look.
