Skip to content

Commit 3fff3bd

Browse files
committed
WIP
1 parent 574ca64 commit 3fff3bd

File tree

1 file changed

+20
-24
lines changed

1 file changed

+20
-24
lines changed

content/getting-started/react-new.textile

Lines changed: 20 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ h2(#prerequisites). Prerequisites
2525

2626
h3(#prerequisites-ably-cli). Install Ably CLI (optional)
2727

28-
* Install the "Ably CLI":https://www.npmjs.com/package/@ably/cli : @npm install -g @ably/cli@
28+
* Install the "Ably CLI":https://www.npmjs.com/package/@ably/cli : @npm install -g @ably/cli@
2929
* Run @ably login@ in the terminal and follow the prompts to provide an access token to the Ably CLI.
3030
* Set the default app to use with @ably apps switch@ and select an API key to use for operations with @ably auth keys switch@.
3131

@@ -60,32 +60,30 @@ Create a new React + TypeScript project using Vite. Select the following options
6060

6161
For detailed instructions, refer to the "Vite documentation":https://vitejs.dev/guide/#scaffolding-your-first-vite-project.
6262

63-
<aside data-type='note'>
64-
<p>You should see a directory structure similar to this:</p>
65-
<code>
66-
├── index.html
67-
├── package.json
68-
├── public
69-
├── src
70-
│ ├── assets
71-
│ ├── App.css
72-
│ ├── App.tsx
73-
│ ├── index.css
74-
│ ├── main.tsx
75-
│ └── vite-env.d.ts
76-
├── tsconfig.app.json
77-
├── tsconfig.json
78-
├── tsconfig.node.json
79-
└── vite.config.ts
80-
</code>
81-
</aside>
63+
You should see a directory structure similar to this:
64+
<code>
65+
├── index.html
66+
├── package.json
67+
├── public
68+
├── src
69+
│ ├── assets
70+
│ ├── App.css
71+
│ ├── App.tsx
72+
│ ├── index.css
73+
│ ├── main.tsx
74+
│ └── vite-env.d.ts
75+
├── tsconfig.app.json
76+
├── tsconfig.json
77+
├── tsconfig.node.json
78+
└── vite.config.ts
79+
</code>
8280

8381
You also need to set up Tailwind CSS for styling the application. For installation instructions, see the "Tailwind CSS documentation for Vite":https://tailwindcss.com/docs/installation/using-vite.
8482

8583
Once installed, remove any existing styles from your @src/index.css@ file and ensure that it contains only the Tailwind CSS import:
8684

8785
```[css]
88-
// src/index.css
86+
/* src/index.css */
8987
@import 'tailwindcss';
9088
```
9189

@@ -137,8 +135,6 @@ createRoot(document.getElementById('root')!).render(
137135
);
138136
```
139137

140-
Ensure you replace the @{{API_KEY}}@ placeholder with your actual Ably API key.
141-
142138
<aside data-type='note'>
143139
<p>Keep the Realtime client initialization outside of any React component to prevent it from being recreated on re-renders, which could result in reaching your Ably connection limit.</p>
144140
</aside>
@@ -176,7 +172,7 @@ Clients establish a connection with Ably when they instantiate an SDK instance.
176172

177173
In the "Set up AblyProvider":#prerequisites-setup-ably-provider section, you added the following code to create a new Ably Realtime client:
178174

179-
```[typescript]
175+
```[react]
180176
const realtimeClient = new Ably.Realtime({
181177
key: '{{API_KEY}}',
182178
clientId: 'my-first-client',

0 commit comments

Comments
 (0)