K
K
kirillleogky2020-02-08 13:46:33
JavaScript
kirillleogky, 2020-02-08 13:46:33

What is the problem with "Unexpected token"?

My main jsx:

import React from 'react'
import ReactDOM from 'react-dom'

import Header from './components/header/header'

ReactDOM.render(<Header />, document.getElementById('wrapper'))


components/header/header.jsx:
import React from 'react';

class Header extends React.Component {
  render() {
    return (
      <header className="header_block">
        <div className="header_block-logo"></div>
        <div className="header_block-score">
          Score:
          <span className="header_block-score_curr" id="score">0</span>
        </div>
      </header>
    );
  }
}

export default Header;


When assembling, an error pops up:
5e3e9148ce8f3718464394.png
Tell me what is the problem?
Indeed, in ReactDOM.render you need to add <Header />
What does he swear?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question