Javascript propTypes声明中出现意外标记

Javascript propTypes声明中出现意外标记,javascript,reactjs,react-boilerplate,Javascript,Reactjs,React Boilerplate,我正在试用react样板。它带有一些发电机 当我生成一个所有选项都勾选“是”的新容器时 ? Select the base component type: React.Component ? What should it be called? UsersPage ? Do you want headers? Yes ? Do you want an actions/constants/selectors/reducer tuple for this container? Yes ? Do you

我正在试用react样板。它带有一些发电机

当我生成一个所有选项都勾选“是”的新容器时

? Select the base component type: React.Component
? What should it be called? UsersPage
? Do you want headers? Yes
? Do you want an actions/constants/selectors/reducer tuple for this container? Yes
? Do you want sagas for asynchronous flows? (e.g. fetching data) Yes
? Do you want i18n messages (i.e. will this component use text)? Yes
? Do you want to load resources asynchronously? Yes
。。。它创建了这个文件

/**
 *
 * DashboardPage
 *
 */

import React from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { Helmet } from 'react-helmet';
import { FormattedMessage } from 'react-intl';
import { createStructuredSelector } from 'reselect';
import { compose } from 'redux';

import injectSaga from 'utils/injectSaga';
import injectReducer from 'utils/injectReducer';
import makeSelectDashboardPage from './selectors';
import reducer from './reducer';
import saga from './saga';
import messages from './messages';

/* eslint-disable react/prefer-stateless-function */
export class DashboardPage extends React.Component {

  render() {
    return (
      <div>
        <Helmet>
          <title>DashboardPage</title>
          <meta name="description" content="Description of DashboardPage" />
        </Helmet>
        <FormattedMessage {...messages.header} />
        <div>
          <CenteredSection>
            <H2>
              <FormattedMessage {...messages.startProjectHeader} />
            </H2>
            <p>
              <FormattedMessage {...messages.startProjectMessage} />
            </p>
          </CenteredSection>
          <Section>
            <H2>
              <FormattedMessage {...messages.trymeHeader} />
            </H2>
          </Section>
      </div>
    );
  }
}

DashboardPage.propTypes = {
  dispatch: PropTypes.func.isRequired,
};

const mapStateToProps = createStructuredSelector({
  dashboardpage: makeSelectDashboardPage(),
});

function mapDispatchToProps(dispatch) {
  return {
    dispatch,
  };
}

const withConnect = connect(
  mapStateToProps,
  mapDispatchToProps,
);

const withReducer = injectReducer({ key: 'dashboardPage', reducer });
const withSaga = injectSaga({ key: 'dashboardPage', saga });

export default compose(
  withReducer,
  withSaga,
  withConnect,
)(DashboardPage);

我希望这个错误能有点帮助。有人能解释一下这里到底出了什么问题吗?

在渲染函数中,您缺少一个结束标记

此外,CenteredSection和Section不会被导入,并且将被取消定义


所以,生成器坏了,或者不够用。

顺便说一句,如果react样板文件的开发人员发现了这个问题,我已经对渲染进行了编辑,忘记了它,并且没有关闭标记/删除对部分的引用,等等。哎哟。
ERROR in ./app/containers/DashboardPage/index.js
Module build failed (from ./node_modules/babel-loader/lib/index.js):
SyntaxError: Unexpected token, expected } (53:10)

  51 | 
  52 | DashboardPage.propTypes = {
> 53 |   dispatch: PropTypes.func.isRequired,
     |           ^
  54 | };
  55 | 
  56 | const mapStateToProps = createStructuredSelector({