Styling React components with a const

I keep getting an “unexpected token” but I can´t see anything wrong with my code. Any ideas?

I’m not sure but you’re treating your Button react component as a button html element.

Provide more details on the error and paste link to your project.

Thanks for the answer. But the style is on the div, so it shouldn´t matter the rest I think?

Oh, sorry!
Failed to compile.

./src/App.js
  Line 12:  Parsing error: Unexpected token

  10 |   }
  11 |
> 12 | const style = {
     |       ^
  13 |   display:"flex"
  14 | }
  15 |

That´s the error.

Like:

  constructor(props) {
    super(props);
    this.state = {
      value: [],
      divStyle: {
        display: "flex"
      }
    };
  }
render() {
    return(
    <div style={this.state.divStyle} id="container">

You were absolutely right! The problem was that I was declaring the variable inside the class. Moved it out and it worked!

Thanks for the complete explanation. I´m still getting used to the Javascript OOP.