Browse Source

Fix React links on the website (#10837)

* Fix React links on the website

* Fix code editor

* Fix code editor, attempt 2
main
Dan Abramov 7 years ago
committed by GitHub
parent
commit
0e87a042a8
  1. 2
      _config.yml
  2. 4
      _js/live_editor.js
  3. 5
      _layouts/default.html
  4. 2
      contributing/how-to-contribute.md
  5. 6
      docs/optimizing-performance.md
  6. 4
      downloads/single-file-example.html

2
_config.yml

@ -60,7 +60,7 @@ sass:
gems:
- jekyll-redirect-from
- jekyll-paginate
react_version: 15.4.0
react_version: 16.0.0
react_hashes:
dev: buVLzxzBI8Ps3svVMSUurNdb5dozNidH5Ow4H0YgZeia3t6Oeui2VLpvtAq1fwtK
prod: nCjsa0kjNQPQdxWm12/ReVJzfBJaVubEwwDswyQDGMKYJmeWv3qShMuETfU5fisu

4
_js/live_editor.js

@ -8,7 +8,7 @@ var IS_MOBILE = (
|| navigator.userAgent.match(/Windows Phone/i)
);
var CodeMirrorEditor = React.createClass({
var CodeMirrorEditor = createReactClass({
propTypes: {
lineNumbers: PropTypes.bool,
onChange: PropTypes.func,
@ -74,7 +74,7 @@ var selfCleaningTimeout = {
},
};
var ReactPlayground = React.createClass({
var ReactPlayground = createReactClass({
mixins: [selfCleaningTimeout],
MODES: {JSX: 'JSX', JS: 'JS'}, //keyMirror({JSX: true, JS: true}),

5
_layouts/default.html

@ -49,8 +49,9 @@
<script src="https://unpkg.com/codemirror@5.15.2/mode/xml/xml.js"></script>
<script src="https://unpkg.com/codemirror@5.15.2/mode/jsx/jsx.js"></script>
<script src="https://unpkg.com/prop-types/prop-types.min.js"></script>
<script src="https://unpkg.com/react/dist/react.min.js"></script>
<script src="https://unpkg.com/react-dom/dist/react-dom.min.js"></script>
<script src="https://unpkg.com/react/umd/react.production.min.js"></script>
<script src="https://unpkg.com/react-dom/umd/react-dom.production.min.js"></script>
<script src="https://unpkg.com/create-react-class/create-react-class.min.js"></script>
<script src="https://unpkg.com/babel-standalone@6.15.0/babel.min.js"></script>
<script src="/react/js/live_editor.js"></script>
</head>

2
contributing/how-to-contribute.md

@ -116,7 +116,7 @@ First, run `npm run build`. This will produce pre-built bundles in `build` folde
The easiest way to try your changes is to run `npm run build` and then open `fixtures/packaging/babel-standalone/dev.html`. This file already uses `react.js` from the `build` folder so it will pick up your changes.
If you want to try your changes in your existing React project, you may copy `build/dist/react.development.js`, `build/dist/react-dom.development.js`, or any other build products into your app and use them instead of the stable version. If your project uses React from npm, you may delete `react` and `react-dom` in its dependencies and use `npm link` to point them to your local `build` folder:
If you want to try your changes in your existing React project, you may copy `build/umd/react.development.js`, `build/umd/react-dom.development.js`, or any other build products into your app and use them instead of the stable version. If your project uses React from npm, you may delete `react` and `react-dom` in its dependencies and use `npm link` to point them to your local `build` folder:
```sh
cd your_project

6
docs/optimizing-performance.md

@ -42,11 +42,11 @@ Remember that this is only necessary before deploying to production. For normal
We offer production-ready versions of React and React DOM as single files:
```html
<script src="https://unpkg.com/react@15/dist/react.min.js"></script>
<script src="https://unpkg.com/react-dom@15/dist/react-dom.min.js"></script>
<script src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
<script src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>
```
Remember that only React files ending with `.min.js` are suitable for production.
Remember that only React files ending with `.production.min.js` are suitable for production.
### Brunch

4
downloads/single-file-example.html

@ -3,8 +3,8 @@
<head>
<meta charset="UTF-8" />
<title>Hello World</title>
<script src="https://unpkg.com/react@latest/dist/react.js"></script>
<script src="https://unpkg.com/react-dom@latest/dist/react-dom.js"></script>
<script src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/babel-standalone@6.15.0/babel.min.js"></script>
</head>
<body>

Loading…
Cancel
Save