Syntax error: Unexpected token, expected ,

zipfstein

I'm getting this syntax error in react:

Unexpected token, expected , (22:4)

  20 | 		        </div>
  21 | 		    </div>
> 22 | 		)}
     | 		 ^
  23 | 	    </section>
  24 | 	  );
  25 | 	}

I've looked at every tag and bracket multiple times through, to see if all had their opening and closing tag/bracket, and I can't seem to find the error. It could be something else, but I'm not good enough in javascript to spot the mistake.

I don't understand the error message either, what excactly does it mean when it says "expected ,"?

Here is the code the error message refering to:

import React, { Component } from 'react';
import dropdownlist from './dropdowndata';

class Links extends Component {
	render() {
	    return (
    	<section>
		    { dropdownlist.map(drop =>(
		      <div className="dropdown">
		      <button className="dropdownhover"> {drop.name} </button>
		      <div className="links">
		    		
		      drop.button.map(button => (
			  <div className="linkssection">
			    <h2> {button.title} </h2>
			    <ul><li><a className="singlelink" href={button.url}>{button.urlText}</a></li></ul>
			  </div>
		      ))
					
		      </div>
		      </div>
			)}
		</section>
		);
	}
}

export default Links;

Thanks in advance! :)

Domey

Close the first map function.

import React, { Component } from 'react';
import dropdownlist from './dropdowndata';

class Links extends Component {
    render() {
        return (
        <section>
            { dropdownlist.map(drop =>(
              <div className="dropdown">
              <button className="dropdownhover"> {drop.name} </button>
              <div className="links">

              drop.button.map(button => (
              <div className="linkssection">
                <h2> {button.title} </h2>
                <ul><li><a className="singlelink" href={button.url}>{button.urlText}</a></li></ul>
              </div>
              ))

              </div>
              </div>
            ))}
        </section>
        );
    }
}

export default Links;

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related