Skip to content
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

How to use Ably with React tutorial syntax update required #2102

Open
mclark-ably opened this issue Jan 17, 2024 · 0 comments
Open

How to use Ably with React tutorial syntax update required #2102

mclark-ably opened this issue Jan 17, 2024 · 0 comments

Comments

@mclark-ably
Copy link

mclark-ably commented Jan 17, 2024

Step 4 of the tutorial https://ably.com/tutorials/how-to-ably-react-hooks#tutorial-step-4 has the following syntax on how to use rewind

const {channel} = useChannel("[?rewind=100]your-channel-name", (message) => {
    // List the last 100 messages on the channel
    console.log(message);
});

However this does not work and the correct syntax would now be

const { channel } = useChannel({ channelName: "your-channel-name", options: { params: { rewind: '100' } } }, (message) => {
   console.log(message);
});

Which has been updated in the ably-js repo React readme ably/ably-js#1523

┆Issue is synchronized with this Jira Task by Unito

@mclark-ably mclark-ably changed the title How to use Ably with React tutorial issue with rewind How to use Ably with React tutorial syntax update required Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant