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

107
Views
Can functional component prop be modified?

I have a functional component that looks like this:

export const Navbarr = ({items}) => {
 

  const [user,  error] = useAuthState(auth);
  const [cartItems, setCartItems]=React.useState(0);

  const fetchUserCartItems=async()=>{
  
      const q = query(collection(db, "users"), where("uid", "==", user?.uid));
      const doc = await getDocs(q);
      const data = doc.docs[0].data();   
      setCartItems(data.cartItems);
      
  }

Can "items" be modified with the value of cartItems? And how?

Thank you

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You cannot modify any props rather it can be handle by event handling to change the state. See this video from the current time duration. After this you know about the event handling and binding. https://www.youtube.com/watch?v=Ke90Tje7VS0&t=3664s

about 4 years ago · Santiago Trujillo 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!