score:0

the problem is not what you have mentioned in the question. the problem is that you are accessing the length of 'grocerylist' when it is not loaded yet. you can solve this problem with safe navigation methods or you can solve this like below:

const grocerylist = (props) => (
  <div>
    {props.user.grocerylist && <addingredients ingredients={props.user.grocerylist} />}
  </div>
);

however, there are several syntaxes that you can use depend on your code and your preference.


Related Query

More Query from same tag