/**
* Copyright (c) 2013-present, Facebook, Inc.
*
* @emails react-core
*/
import ButtonLink from 'components/ButtonLink';
import Container from 'components/Container';
import Flex from 'components/Flex';
import CodeExample from 'components/CodeExample';
import PropTypes from 'prop-types';
import React, {Component} from 'react';
import {graphql} from 'gatsby';
import TitleAndMetaTags from 'components/TitleAndMetaTags';
import Layout from 'components/Layout';
import {colors, media, sharedStyles} from 'theme';
import loadScript from 'utils/loadScript';
import createOgUrl from 'utils/createOgUrl';
import {babelURL} from 'site-constants';
import ReactDOM from 'react-dom';
import logoWhiteSvg from 'icons/logo-white.svg';
class Home extends Component {
state = {
babelLoaded: false,
};
componentDidMount() {
loadScript(babelURL).then(
() => {
this.setState({
babelLoaded: true,
});
},
error => {
console.error('Babel failed to load.');
},
);
}
render() {
const {babelLoaded} = this.state;
const {data, location} = this.props;
const {codeExamples, examples, marketing} = data;
const code = codeExamples.edges.reduce((lookup, {node}) => {
lookup[node.mdAbsolutePath] = node;
return lookup;
}, {});
return (
A JavaScript library for building user interfaces
React
{column.frontmatter.title}
{node.frontmatter.title}