adobe/react-spectrum-charts

Improve error messaging when data is undefined

Opened this issue · 2 comments

Provide a general summary of the feature here

Currently, if data is undefined the library crashes - this should be handled gracefully.

Screenshot 2023-10-27 at 10 24 39 AM

🤔 Expected Behavior?

Undefined data should not be crashing the application, ideally it should follow the same flow as an empty array of data.

💁 Possible Solution

No response

🔦 Context

This would crash the application:

<Prism>
   ...
</Prism>

This is handled gracefully:

<Prism data={[]}>
   ...
</Prism>

💻 Examples

No response

🧢 Your Company/Team

Adobe

Hi @evargast ,
I would like to give it a try. I might need help though. Can you guide me on how to approach the issue?

Hey @shubhexists! Absolutely, I would imagine we need to expand this conditional to include data === undefined

Then add the related tests to ensure that undefined data follows the same flow as empty data