Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

146
Views
Mi búsqueda no funciona, no va a /productos/

Si voy a /productos/ y al final agrego algo, buscará entre todos los productos, pero cuando trato de presionar el botón de búsqueda, no hace nada, ni siquiera va a /productos/.

No sé si debería usar Button en lugar de input, estoy siguiendo un tutorial y funciona allí

 const Search = ({ history }) => { const [keyword, setKeyword] = useState(""); const searchSubmitHandler = (e) => { e.preventDefault(); if (keyword.trim()) { history.push(`/products/${keyword}`); } else{ history.push("/products"); } }; return ( <Fragment> <form className="searchBox" onSubmit={searchSubmitHandler}> <input type="text" placeholder="Search a Product ..." onChange={(e) => setKeyword(e.target.value)} /> <input type="submit" value="Search" /> </form> </Fragment> ); }; export default Search here
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Intente cancelar e.preventDefault ();

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!