Tell us what’s happening:
Hello everyone. In order to complete the Drum Machine test, I’m trying to create a React Component that will act as a dummy button that I can fill with the key and soundclip I need. To do this, I’m trying to pass a key
props to my Button
component. I am doing the way I think I’m supposed to, but I end up with an empty buton, with no “Q” inside it. What am I doing wrong ?
Your code so far
const Button = (props) => {
return (
<div id="display">
<button>{props.key}</button>
</div>
);
};
class Test extends React.Component {
render() {
return (
<div id="display">
<p>"Dummy text"</p>
<Button key="Q" />
</div>
);
}
}
ReactDOM.render(<Test />, document.getElementById("drum-machine"));
Your browser information:
User Agent is: Mozilla/5.0 (X11; CrOS x86_64 14324.62.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.77 Safari/537.36
Challenge: Build a Drum Machine
Link to the challenge: