react-spectrum-charts icon indicating copy to clipboard operation
react-spectrum-charts copied to clipboard

Improve error messaging when data is undefined

Open evargast opened this issue 2 years ago • 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

evargast avatar Oct 27 '23 15:10 evargast

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?

shubhexists avatar Oct 28 '23 10:10 shubhexists

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

evargast avatar Nov 17 '23 16:11 evargast