Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

273
Vistas
I'm making a searchbar component with suggestions, but why is the list I'm rendering for suggestions showing a semicolon as one of the list items?

This is my searchbar with suggestions component that I'm working on:

import React from 'react';
import { FiSearch } from 'react-icons/fi';
import '../CSS/SearchBar.css'
import productsData from './../productsData.json'
import 'bootstrap/dist/css/bootstrap.min.css'
    
class SearchBar extends React.Component {
      constructor(props) {
        super(props);
        this.state = {
          typed:""
        }
    
        this.userTyped = this.userTyped.bind(this);
      }  
    
      userTyped(e) {
        this.setState({
          typed: e.target.value
        })
      }
      
      render() {
    
        return (
          <div className='searchbar'>
            <div className='wrapper'> 
              <input 
              type='text'
              value={this.state.typed}
              onChange={this.userTyped}
              />
    
              <button>
                <FiSearch size={18}/>
              </button>
            </div>
    
            <ul className='list-group suggestions'>
              {productsData.map((item) => {
                return (
                  <button id='list-item' className='list-group-item list-group-item-action'>
                    {item.title}
                    </button>
    
                )
              })};
              
            </ul> 
          </div>
        )
      }
      

}

The map function uses productsData that is a json file with five items in it.

And this is what the semicolon I'm confused about. Its at the bottom of the list: my searchbar

I was wondering if the cause of this is returning my button element, but I wasn't sure how else to go about it.

Would appreciate any help! Pretty new at this.

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda