Skip to content
This repository has been archived by the owner on Nov 18, 2018. It is now read-only.

The react in es6 defines the defaultProps error in the component. #95

Open
huangjihua opened this issue Jan 27, 2018 · 1 comment
Open

Comments

@huangjihua
Copy link

taxError: /Users/huangjihua/Documents/autohome/projects/re-bulma/src/components/panel/panel-tabs.js: Unexpected token (6:19
`export default class PanelTabs extends Component {

6 | static propTypes = {
| ^
7 | children: PropTypes.any,
8 | className: PropTypes.string,
9 | style: PropTypes.object,
`
Defining the static property is not es6, and in the es7 draft, install the babel-preset-stage-0 and try again after the babelrc reference, but not yet.

@davidnguyen11
Copy link

I solved by below steps:
replace .babelrc content with this content

{
  "presets": ["react", "es2015", "stage-1"]
}

run commands below:

yarn run build
yarn run styleguide-server

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants