Skip to content

[EDU-1993] - Add Chat's React Native getting started guide #2687

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

GregHolmes
Copy link
Contributor

@GregHolmes GregHolmes commented Jun 25, 2025

A new getting started guide for Chat in React Native using Expo.

@GregHolmes GregHolmes self-assigned this Jun 25, 2025
@ably-ci ably-ci temporarily deployed to ably-docs-edu-1993-crea-mvuhgu June 25, 2025 11:47 Inactive
Copy link

coderabbitai bot commented Jun 25, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch EDU-1993-Create-React-Native-getting-started-Guide-for-Chat

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@GregHolmes GregHolmes force-pushed the EDU-1993-Create-React-Native-getting-started-Guide-for-Chat branch 3 times, most recently from 761fe29 to bbc1684 Compare July 7, 2025 08:42
Copy link
Contributor

@splindsay-92 splindsay-92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a few comments, but looks good!

@GregHolmes GregHolmes force-pushed the EDU-1993-Create-React-Native-getting-started-Guide-for-Chat branch from bbc1684 to 4b44f1e Compare July 10, 2025 13:28
@GregHolmes GregHolmes force-pushed the EDU-1993-Create-React-Native-getting-started-Guide-for-Chat branch 2 times, most recently from 80cd3d8 to 4d476ba Compare July 23, 2025 09:58
@GregHolmes GregHolmes added the review-app Create a Heroku review app label Jul 23, 2025
@ably-ci ably-ci temporarily deployed to ably-docs-edu-1993-crea-g2r0kz July 23, 2025 10:26 Inactive
@GregHolmes GregHolmes temporarily deployed to ably-docs-edu-1993-crea-g2r0kz July 24, 2025 08:38 Inactive
@GregHolmes GregHolmes force-pushed the EDU-1993-Create-React-Native-getting-started-Guide-for-Chat branch from 12a03ee to 28f321e Compare July 28, 2025 12:08
@GregHolmes GregHolmes temporarily deployed to ably-docs-edu-1993-crea-g2r0kz July 28, 2025 12:09 Inactive
@GregHolmes GregHolmes requested a review from splindsay-92 July 28, 2025 12:17
@GregHolmes
Copy link
Contributor Author

Thanks @splindsay-92 I've updated the PR based on your feedback. If you could give it another look over, that would be greatly appreciated.

@GregHolmes GregHolmes force-pushed the EDU-1993-Create-React-Native-getting-started-Guide-for-Chat branch from 28f321e to dbc3fdb Compare August 4, 2025 08:17
@GregHolmes GregHolmes requested a review from splindsay-92 August 4, 2025 09:55
@GregHolmes
Copy link
Contributor Author

Thank you @splindsay-92 I've updated from your feedback to have the new functionality of the Chat SDK. Please let me know what you think (It's in the fixup)

Display the online status of clients using the presence feature. This enables clients to be aware of one another if they are present in the same room. You can then show clients who else is online, provide a custom status update for each, and notify the room when someone enters it, or leaves it, such as by going offline.

The Chat SDK exposes both the [`usePresence()`](https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/functions/chat-react.usePresence.html) and [`usePresenceListener()`](https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/functions/chat-react.usePresenceListener.html) hooks to interact with the presence feature. The `usePresence()` hook allows you to enter the room and update your presence status, while the `usePresenceListener()` hook allows you to subscribe to presence updates for the room.
The [`usePresenceListener()`](https://sdk.ably.com/builds/ably/ably-chat-js/main/typedoc/functions/chat-react.usePresenceListener.html) hook also returns an object with the `presenceData` array, which contains the current presence data for the room.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor nitpick, it looks a bit strange in the browser that usePresenceListener is linked externally twice, where usePresence is not. I'd be happy to say link all occurrences, or just link the first two :)

// ChatApp.tsx
function ReactionComponent() {
const reactions = ['👍', '❤️', '💥', '🚀', '👎', '💔'];
const [roomReactions, setRoomReactions] = useState<Reaction[]>([]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is the correct type, shouldn't it be RoomReaction?


### Automatic detachment on unmount <a id="auto-detach"/>

For React Native components, when a component using the `ChatRoomProvider` unmounts, the room will automatically detach from the underlying channel and clean up associated resources. This behavior is controlled by the `release` prop on the `ChatRoomProvider`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is no longer the case, release and cleanup are automatic on unmount now :) There is no longer a release prop.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only time you will need to manually release a room now, is if you aren't using the room provider :)

@GregHolmes GregHolmes force-pushed the EDU-1993-Create-React-Native-getting-started-Guide-for-Chat branch from edca8fa to f249200 Compare August 13, 2025 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review-app Create a Heroku review app
Development

Successfully merging this pull request may close these issues.

3 participants