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

90
Views
Modify Interface values while using useContext in React Native

I have a context like this, In each page I have to update certain fields in the interface from their initial values, how can I change each values in that interface

Assignment operator shows error :- The left-hand side of an assignment expression may not be an optional property access.ts(2779)

import * as React from "react";

interface OrderContextInterface {
    outboundQuoteId: string;
    senderId: string;
    receiverId: string;
    routeId: number;
    paymentOptionId: number;
    purposeOfTransaction: string
}

export const OrderContext = React.createContext<OrderContextInterface | null>(null);


export const initialOrder: OrderContextInterface = {
    outboundQuoteId: '',
    senderId: '',
    receiverId: '',
    routeId: 0,
    paymentOptionId: 0,
    purposeOfTransaction: '',
};



//In Other Screens



  useEffect(() => {
    order?.outboundQuoteId="ada";     **//error** 
 
 
}, []);


//contexts
const order = useContext(OrderContext);

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!