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

194
Views
everything working but url gives the initial value of state and when refresh gives me uncaught (in promise) Error: Request failed wit status code 404

here is my code****************************************************** App comp


function App() {
  const [shipNumber, setShipNumber] = useState('');  // every time return to the initial value here 

Routing is here ==>

       <BrowserRouter>
                <div className="content">
                    <Routes>

                        <Route exact path="/" element={ <Tracking shipNumber={shipNumber} setShipNumber = {setShipNumber} isChanged={isChanged} trackShipment={trackShipment}/>} />
                        <Route path="/status/:trackingnumber" element={<Status  shipNumber={shipNumber} />} />
                    </Routes>
                </div>
            </BrowserRouter>
    </div>
  );
}

**************************************************************Tracking comp

const Tracking = ( props) => {
  let navigate = useNavigate();
  const handleChange=(e)=>{
    e.preventDefault();
    const trackingNo = e.target.value;
    props.setShipNumber(trackingNo);
  };
  const handleClick =(e)=>{
    e.preventDefault();

here is trying to navigate

    navigate(`/status/${props.setIsChanged && props.shipNumber}`);
  };

  <form type="submit" onSubmit={props.trackShipment}>
    <input onChange={handleChange} value={props.shipNumber} placeholder='Tracking No.' required></input>
  

Status Comp

const Status = (props) => {
  const [shipment,setShipment]= useState(null);

===>

  const url = `https://tracking.bosta.co/shipments/track/${props.shipNumber}`;
  useEffect(()=>{
    axios.get(url).then(response=>{
      setShipment(response.data)
  
    })

  },[url]);
  
about 4 years ago · Juan Pablo Isaza
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!