Obsolete state in useIonViewWillEnter

Ok. The solution is to add customers to dependencies list - the second arg to useIonViewWillEnter

  useIonViewWillEnter(() => {
    const customerOne = customers[0]
    fn_that_programmatically_populates_form_fields(customerOne)
    console.log('useIonViewWillEnter', customers[0])
  }, **[customers]**);

Which is NOT documented

2 Likes