Build a Drum Machine[Berlin]

Tell us what’s happening:
my drum machine isn’t rendering, i don’t know where the problem could be coming from… please help

Your code so far


Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3223.0 Safari/537.36.

Link to the challenge:

let display=characters.map((x,index)=>{
    return
    <Drumpad name={x} src={sounds[index]} key={index} click={props.click}/>
  });

The return keyword must always be followed by an expression. JavaScript is automatically inserting a semicolon, so your Drumpad component is not being returned.

let display=characters.map((x,index)=>{
    return <Drumpad name={x} src={sounds[index]} key={index} click={props.click}/>;
  });

You could also wrap the expression in parentheses:

let display=characters.map((x,index)=>{
    return (
       <Drumpad name={x} src={sounds[index]} key={index} click={props.click}/>
    );
  });
1 Like

thanks… this was helpful