Blocking - I opened up a project today that was working fine the last time I checked and I get an error in preview : Error: Cannot read property 0 - data is still loading . After checking everything I could think of three times over, I am starting to wonder if maybe it’s not on my side.
@chungwu I think I tracked down this error to a state variable that has an initial value based on a query. If I remove the initial value, the error goes away.
However, I believe it worked before despite it relying on the query for initial value.
Is there a better way to initialize a state variable in this case so it waits until the query has finished loading?
After much poking, I was able to isolate the issue to a Data provider that had a Data prop set as in the screenshot. The only workaround I could find is to set the Data Provider component to Not Rendered, since anything else causes the error in Preview - even if the Data Provider is empty/no children.
Can a Data Provider not rely on a state variable for its data?