I don't understand why my project searchbar doesn't do anything in the Jamming project

import React from ‘react’;

import ‘./SearchBar.css’;

export class SearchBar extends React.Component {

constructor(props) {
super(props);
this.state = {term: ‘’}
this.search = this.search.bind(this);
this.handleTermChange = this.handleTermChange.bind(this);
}

search() {
this.props.onSearch(this.state.term);
}

handleTermChange(event) {
this.setState({term: event.target.value});
}

render() {
return(



SEARCH

)
}
}

My project is completed and not sure exactly which step you are at but eventually you need to add JSX code in the return statement where you have ‘SEARCH’ now. You will need to return a div containing an input and a button with the correct className-attributes.

Also: It is helpful to press the little </> symbol when posting and paste code in there so that it gets formatted correctly as JS-code in the forum.

Hi Mike, I finished the project, I still have a unused item in one of my files. At the moment when I click the search bar it does nothing to get something from spotify. I am not sure what code I missed during the walkthrough. I don't know why my divs did not show up but they were there. here is my code from SearchBar component.

import React from 'react';
import './SearchBar.css';
export class SearchBar extends React.Component {

  constructor(props) {
    super(props);
    this.state = {term: ''}
    this.search = this.search.bind(this);
    this.handleTermChange = this.handleTermChange.bind(this);
  }
  search() {
    this.props.onSearch(this.state.term);
  }
  handleTermChange(event) {
    this.setState({term: event.target.value});
  }

  render() {
    return(
      <div className="SearchBar">
        <input placeholder="Enter A Song, Album, or Artist" onChange={this.handleTermChange} />
        <button className="SearchButton">SEARCH</button>
    </div>
    )
  }
}

Your Search button should have an onClick attribute to fire the function so try to add that. I think the div, input, and button got removed in first post since they were html tags and you initially did not use the code-formatting option. If the onClick does not fix it then this is a project where you may need to post code from other components as well.