-
Notifications
You must be signed in to change notification settings - Fork 47.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update the homepage with ES6 (#7868)
* Update the homepage with ES6 * Avoid array spread and stale state
- Loading branch information
Showing
8 changed files
with
104 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,8 +6,8 @@ require('open-uri') | |
desc "download babel-browser" | ||
task :fetch_remotes do | ||
IO.copy_stream( | ||
open('https://cdnjs.cloudflare.com/ajax/libs/babel-core/5.8.34/browser.min.js'), | ||
'js/babel-browser.min.js' | ||
open('https://unpkg.com/babel-[email protected]/babel.min.js'), | ||
'js/babel.min.js' | ||
) | ||
end | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
var name = Math.random() > 0.5 ? 'Jane' : 'John'; | ||
var HELLO_COMPONENT = ` | ||
var HelloMessage = React.createClass({ | ||
render: function() { | ||
class HelloMessage extends React.Component { | ||
render() { | ||
return <div>Hello {this.props.name}</div>; | ||
} | ||
}); | ||
} | ||
ReactDOM.render(<HelloMessage name="John" />, mountNode); | ||
`; | ||
ReactDOM.render(<HelloMessage name="${name}" />, mountNode); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
gaearon
Author
Collaborator
|
||
`.trim(); | ||
|
||
ReactDOM.render( | ||
<ReactPlayground codeText={HELLO_COMPONENT} />, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Forgot backticks around ${name} ?