diff --git a/website/core/AlgoliaDocSearch.js b/website/core/AlgoliaDocSearch.js
index 49cf90025..1a0e544d0 100644
--- a/website/core/AlgoliaDocSearch.js
+++ b/website/core/AlgoliaDocSearch.js
@@ -12,14 +12,14 @@
var React = require('React');
-var AlgoliaDocSearch = React.createClass({
- render: function() {
+class AlgoliaDocSearch extends React.Component {
+ render() {
return (
);
}
-});
+}
module.exports = AlgoliaDocSearch;
diff --git a/website/core/BlogPost.js b/website/core/BlogPost.js
index 432fc9617..50ba3d561 100644
--- a/website/core/BlogPost.js
+++ b/website/core/BlogPost.js
@@ -17,8 +17,8 @@ var BlogPostHeader = require('BlogPostHeader');
var BlogPostFooter = require('BlogPostFooter');
var ExcerptLink = require('ExcerptLink');
-var BlogPost = React.createClass({
- render: function() {
+class BlogPost extends React.Component {
+ render() {
var post = this.props.post;
return (
@@ -31,6 +31,6 @@ var BlogPost = React.createClass({
);
}
-});
+}
module.exports = BlogPost;
diff --git a/website/core/BlogPostDate.js b/website/core/BlogPostDate.js
index 7dd4d9d85..f2a6b2c9e 100644
--- a/website/core/BlogPostDate.js
+++ b/website/core/BlogPostDate.js
@@ -13,8 +13,8 @@
var React = require('React');
-var BlogPostDate = React.createClass({
- render: function() {
+class BlogPostDate extends React.Component {
+ render() {
var post = this.props.post;
var match = post.publishedAt.match(/([0-9]+)-([0-9]+)-([0-9]+)/);
@@ -32,6 +32,6 @@ var BlogPostDate = React.createClass({
);
}
-});
+}
module.exports = BlogPostDate;
diff --git a/website/core/BlogPostExcerpt.js b/website/core/BlogPostExcerpt.js
index 3f5c5b2d6..644a73435 100644
--- a/website/core/BlogPostExcerpt.js
+++ b/website/core/BlogPostExcerpt.js
@@ -16,8 +16,8 @@ var BlogPostHeader = require('BlogPostHeader');
var Marked = require('Marked');
var ExcerptLink = require('ExcerptLink');
-var BlogPostExcerpt = React.createClass({
- render: function() {
+class BlogPostExcerpt extends React.Component {
+ render() {
var post = this.props.post;
return (
@@ -33,6 +33,6 @@ var BlogPostExcerpt = React.createClass({
);
}
-});
+}
module.exports = BlogPostExcerpt;
diff --git a/website/core/BlogPostFooter.js b/website/core/BlogPostFooter.js
index a0be8ecf4..dbfdd421a 100644
--- a/website/core/BlogPostFooter.js
+++ b/website/core/BlogPostFooter.js
@@ -14,8 +14,8 @@
var React = require('React');
var BlogPostDate = require('BlogPostDate');
-var BlogPostFooter = React.createClass({
- render: function() {
+class BlogPostFooter extends React.Component {
+ render() {
var post = this.props.post;
var authorImage = this.props.post.authorImage ? this.props.post.authorImage : '/react-native/img/author.png';
@@ -58,6 +58,6 @@ var BlogPostFooter = React.createClass({
);
}
-});
+}
module.exports = BlogPostFooter;
diff --git a/website/core/BlogPostHeader.js b/website/core/BlogPostHeader.js
index 53308c237..a275d0de7 100644
--- a/website/core/BlogPostHeader.js
+++ b/website/core/BlogPostHeader.js
@@ -14,8 +14,8 @@
var React = require('React');
var BlogPostDate = require('BlogPostDate');
-var BlogPostHeader = React.createClass({
- render: function() {
+class BlogPostHeader extends React.Component {
+ render() {
var post = this.props.post;
var hero;
@@ -54,6 +54,6 @@ var BlogPostHeader = React.createClass({
);
}
-});
+}
module.exports = BlogPostHeader;
diff --git a/website/core/DocsSidebar.js b/website/core/DocsSidebar.js
index dd0d5f878..dc196d233 100644
--- a/website/core/DocsSidebar.js
+++ b/website/core/DocsSidebar.js
@@ -13,8 +13,15 @@
var Metadata = require('Metadata');
var React = require('React');
-var DocsSidebar = React.createClass({
- getCategories: function() {
+class DocsSidebar extends React.Component {
+ constructor(props, context) {
+ super(props, context);
+
+ this.getCategories = this.getCategories.bind(this);
+ this.getLink = this.getLink.bind(this);
+ }
+
+ getCategories() {
var metadatas = Metadata.files.filter(function(metadata) {
return metadata.layout === 'docs' || metadata.layout === 'autodocs';
});
@@ -67,13 +74,13 @@ var DocsSidebar = React.createClass({
categories.push(currentCategory);
return categories;
- },
+ }
- getLink: function(metadata) {
+ getLink(metadata) {
return metadata.permalink;
- },
+ }
- render: function() {
+ render() {
return
{this.getCategories().map((category) =>
@@ -97,6 +104,6 @@ var DocsSidebar = React.createClass({
;
}
-});
+}
module.exports = DocsSidebar;
diff --git a/website/core/EjectBanner.js b/website/core/EjectBanner.js
index 7a5c05c1b..41af8fccd 100644
--- a/website/core/EjectBanner.js
+++ b/website/core/EjectBanner.js
@@ -12,8 +12,8 @@
var React = require('React');
-var EjectBanner = React.createClass({
- render: function() {
+class EjectBanner extends React.Component {
+ render() {
return (
Project with Native Code Required
@@ -25,6 +25,6 @@ var EjectBanner = React.createClass({
);
}
-});
+}
module.exports = EjectBanner;
diff --git a/website/core/ExcerptLink.js b/website/core/ExcerptLink.js
index 7a0ab14f7..b167bd8be 100644
--- a/website/core/ExcerptLink.js
+++ b/website/core/ExcerptLink.js
@@ -13,8 +13,8 @@
var React = require('React');
-var ExcerptLink = React.createClass({
- render: function() {
+class ExcerptLink extends React.Component {
+ render() {
var cta = "Read more";
if (this.props.category === "videos") {
@@ -29,6 +29,6 @@ var ExcerptLink = React.createClass({
);
}
-});
+}
module.exports = ExcerptLink;
diff --git a/website/core/Footer.js b/website/core/Footer.js
index 7220e7ea3..b1e2ceac5 100644
--- a/website/core/Footer.js
+++ b/website/core/Footer.js
@@ -16,14 +16,14 @@ function getGitHubPath(path) {
return 'https://github.com/facebook/react-native/blob/master/' + path;
}
-var Footer = React.createClass({
- render: function() {
+class Footer extends React.Component {
+ render() {
return (
You can edit the content above on GitHub and send us a pull request!
);
}
-});
+}
module.exports = Footer;
diff --git a/website/core/H2.js b/website/core/H2.js
index 893a5508b..a19de1519 100644
--- a/website/core/H2.js
+++ b/website/core/H2.js
@@ -13,10 +13,10 @@
var Header = require('Header');
var React = require('React');
-var H2 = React.createClass({
- render: function() {
+class H2 extends React.Component {
+ render() {
return ;
}
-});
+}
module.exports = H2;
diff --git a/website/core/Header.js b/website/core/Header.js
index 6b68a96f7..4f78a0f48 100644
--- a/website/core/Header.js
+++ b/website/core/Header.js
@@ -16,12 +16,8 @@ var PropTypes = require('prop-types');
var slugify = require('slugify');
-var Header = React.createClass({
- contextTypes: {
- permalink: PropTypes.string
- },
-
- render: function() {
+class Header extends React.Component {
+ render() {
var slug = slugify(this.props.toSlug || this.props.children);
var H = 'h' + this.props.level;
var base = this.context.permalink || '';
@@ -33,6 +29,10 @@ var Header = React.createClass({
);
}
-});
+}
+
+Header.contextTypes = {
+ permalink: PropTypes.string
+};
module.exports = Header;
diff --git a/website/core/HeaderLinks.js b/website/core/HeaderLinks.js
index 50bf78f4b..7b38f8d66 100644
--- a/website/core/HeaderLinks.js
+++ b/website/core/HeaderLinks.js
@@ -13,18 +13,19 @@
var AlgoliaDocSearch = require('AlgoliaDocSearch');
var React = require('React');
-var HeaderLinks = React.createClass({
- linksInternal: [
- {section: 'docs', href: 'docs/getting-started.html', text: 'Docs', target: '.nav-docs'},
- {section: 'support', href: '/react-native/support.html', text: 'Help'},
- {section: 'blog', href: '/react-native/blog/', text: 'Blog'},
- ],
- linksExternal: [
- {section: 'github', href: 'https://github.com/facebook/react-native', text: 'GitHub'},
- {section: 'react', href: 'http://facebook.github.io/react', text: 'React'},
- ],
+var linksInternal = [
+ {section: 'docs', href: 'docs/getting-started.html', text: 'Docs', target: '.nav-docs'},
+ {section: 'support', href: '/react-native/support.html', text: 'Help'},
+ {section: 'blog', href: '/react-native/blog/', text: 'Blog'},
+];
- makeLinks: function(links) {
+var linksExternal = [
+ {section: 'github', href: 'https://github.com/facebook/react-native', text: 'GitHub'},
+ {section: 'react', href: 'http://facebook.github.io/react', text: 'React'},
+];
+
+class HeaderLinks extends React.Component {
+ makeLinks(links) {
return links.map(function(link) {
return (
@@ -37,23 +38,23 @@ var HeaderLinks = React.createClass({
);
}, this);
- },
+ }
- render: function() {
+ render() {
return (
- {this.makeLinks(this.linksInternal)}
+ {this.makeLinks(linksInternal)}
- {this.makeLinks(this.linksExternal)}
+ {this.makeLinks(linksExternal)}
);
}
-});
+}
module.exports = HeaderLinks;
diff --git a/website/core/HeaderWithGithub.js b/website/core/HeaderWithGithub.js
index 9588d3799..e64c6cefd 100644
--- a/website/core/HeaderWithGithub.js
+++ b/website/core/HeaderWithGithub.js
@@ -19,13 +19,8 @@ function getGitHubPath(path) {
return 'https://github.com/facebook/react-native/blob/master/' + path;
}
-var HeaderWithGithub = React.createClass({
-
- contextTypes: {
- version: PropTypes.string
- },
-
- render: function() {
+class HeaderWithGithub extends React.Component {
+ render() {
return (
@@ -47,6 +42,10 @@ var HeaderWithGithub = React.createClass({
);
}
-});
+}
+
+HeaderWithGithub.contextTypes = {
+ version: PropTypes.string
+};
module.exports = HeaderWithGithub;
diff --git a/website/core/Hero.js b/website/core/Hero.js
index 79463ce46..9c4fa4c94 100644
--- a/website/core/Hero.js
+++ b/website/core/Hero.js
@@ -12,8 +12,8 @@
var React = require('React');
-var Hero = React.createClass({
- render: function() {
+class Hero extends React.Component {
+ render() {
return (
@@ -26,6 +26,6 @@ var Hero = React.createClass({
);
}
-});
+}
module.exports = Hero;
diff --git a/website/core/Marked.js b/website/core/Marked.js
index d105e1f30..82b2d297b 100644
--- a/website/core/Marked.js
+++ b/website/core/Marked.js
@@ -1193,15 +1193,15 @@ marked.inlineLexer = InlineLexer.output;
marked.parse = marked;
-var Marked = React.createClass({
- render: function() {
+class Marked extends React.Component {
+ render() {
return this.props.children
? React.DOM.div(
null,
marked(this.props.children, this.props)
)
: null;
- },
-});
+ }
+}
module.exports = Marked;
diff --git a/website/core/Prism.js b/website/core/Prism.js
index 6662ecaa3..ed9697fd3 100644
--- a/website/core/Prism.js
+++ b/website/core/Prism.js
@@ -526,16 +526,8 @@ _.languages.java = _.languages.extend('clike', {
},
});
-var Prism = React.createClass({
- statics: {
- _: _,
- },
- getDefaultProps: function() {
- return {
- language: 'javascript',
- };
- },
- render: function() {
+class Prism extends React.Component {
+ render() {
var grammar = _.languages[this.props.language];
if (!grammar) {
grammar = _.languages.javascript;
@@ -549,7 +541,12 @@ var Prism = React.createClass({
)}
);
- },
-});
+ }
+}
+
+Prism._ = _;
+Prism.defaultProps = {
+ language: 'javascript',
+};
module.exports = Prism;
diff --git a/website/core/ShowcaseAppIcon.js b/website/core/ShowcaseAppIcon.js
index fdad755ef..7ecafa908 100644
--- a/website/core/ShowcaseAppIcon.js
+++ b/website/core/ShowcaseAppIcon.js
@@ -13,14 +13,14 @@
var React = require('React');
-const ShowcaseAppIcon = React.createClass({
- render: function() {
+class ShowcaseAppIcon extends React.Component {
+ render() {
return (
);
}
-});
+}
module.exports = ShowcaseAppIcon;
diff --git a/website/core/Site.js b/website/core/Site.js
index 8302e9284..c6721e211 100644
--- a/website/core/Site.js
+++ b/website/core/Site.js
@@ -14,8 +14,8 @@ var HeaderLinks = require('HeaderLinks');
var Metadata = require('Metadata');
var React = require('React');
-var Site = React.createClass({
- render: function() {
+class Site extends React.Component {
+ render() {
const path = Metadata.config.RN_DEPLOYMENT_PATH;
const version = Metadata.config.RN_VERSION;
const algoliaVersion = version === 'next'
@@ -426,6 +426,7 @@ var Site = React.createClass({