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

241
Views
ReacJs: cómo usar la variable de estado de un módulo a otro módulo

Soy nuevo en ReactJS, estoy tratando de usar la variable city_name en otro módulo y no puedo encontrarla, ayúdenme con esto

 import { useState } from "react"; const SearchCity = (props) => { const { type = "text", placeHolder = "scarch...", name,} = props; const [city_name, setCityName] = useState(""); return ( <div className="flex border-2 border-gray-200 rounded"> <input class="px-4 py-2 w-80 text-black take-input" type={type} name={name} placeholder={placeHolder} onChange={(e) => setCityName(e.target.value)} /> <button className="px-4 text-white bg-gray-600 border-l"> Search... </button> </div> ); }; export default SearchCity;
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Simplemente envíe city_name como apoyo y desestructurarlo.

suponga que tiene un componente <Home/> y tiene que pasar city_name en el componente home.

 // here sending data as prop <Home city_name = {city_name}/> // Recive data const home = ({city_name}) => { <div> </div> }
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!