Skip to content

Commit 9c2e893

Browse files
davidjbalexkrolick
authored andcommitted
Use gist URLs instead of RawGit in React docs (#2385)
RawGit is being shut down (eg Oct 2019, https://rawgit.com/) and this change uses the direct links to the files as served from gist.github.com. The same files are being served, just that the links are only dependent on GitHub's gist service.
1 parent 453a3bd commit 9c2e893

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

content/docs/add-react-to-a-website.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,13 @@ The first two tags load React. The third one will load your component code.
6969

7070
Create a file called `like_button.js` next to your HTML page.
7171

72-
Open **[this starter code](https://cdn.rawgit.com/gaearon/0b180827c190fe4fd98b4c7f570ea4a8/raw/b9157ce933c79a4559d2aa9ff3372668cce48de7/LikeButton.js)** and paste it into the file you created.
72+
Open **[this starter code](https://gist.github.com/gaearon/0b180827c190fe4fd98b4c7f570ea4a8/raw/b9157ce933c79a4559d2aa9ff3372668cce48de7/LikeButton.js)** and paste it into the file you created.
7373

7474
>Tip
7575
>
7676
>This code defines a React component called `LikeButton`. Don't worry if you don't understand it yet -- we'll cover the building blocks of React later in our [hands-on tutorial](/tutorial/tutorial.html) and [main concepts guide](/docs/hello-world.html). For now, let's just get it showing on the screen!
7777
78-
After **[the starter code](https://cdn.rawgit.com/gaearon/0b180827c190fe4fd98b4c7f570ea4a8/raw/b9157ce933c79a4559d2aa9ff3372668cce48de7/LikeButton.js)**, add two lines to the bottom of `like_button.js`:
78+
After **[the starter code](https://gist.github.com/gaearon/0b180827c190fe4fd98b4c7f570ea4a8/raw/b9157ce933c79a4559d2aa9ff3372668cce48de7/LikeButton.js)**, add two lines to the bottom of `like_button.js`:
7979

8080
```js{3,4}
8181
// ... the starter code you pasted ...
@@ -195,7 +195,7 @@ npx babel --watch src --out-dir . --presets react-app/prod
195195
196196
Don't wait for it to finish -- this command starts an automated watcher for JSX.
197197

198-
If you now create a file called `src/like_button.js` with this **[JSX starter code](https://cdn.rawgit.com/gaearon/c8e112dc74ac44aac4f673f2c39d19d1/raw/09b951c86c1bf1116af741fa4664511f2f179f0a/like_button.js)**, the watcher will create a preprocessed `like_button.js` with the plain JavaScript code suitable for the browser. When you edit the source file with JSX, the transform will re-run automatically.
198+
If you now create a file called `src/like_button.js` with this **[JSX starter code](https://gist.github.com/gaearon/c8e112dc74ac44aac4f673f2c39d19d1/raw/09b951c86c1bf1116af741fa4664511f2f179f0a/like_button.js)**, the watcher will create a preprocessed `like_button.js` with the plain JavaScript code suitable for the browser. When you edit the source file with JSX, the transform will re-run automatically.
199199

200200
As a bonus, this also lets you use modern JavaScript syntax features like classes without worrying about breaking older browsers. The tool we just used is called Babel, and you can learn more about it from [its documentation](https://babeljs.io/docs/en/babel-cli/).
201201

0 commit comments

Comments
 (0)