Improve error messaging when data is undefined
Opened this issue · 2 comments
evargast commented
Provide a general summary of the feature here
Currently, if data is undefined the library crashes - this should be handled gracefully.
🤔 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
shubhexists commented
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?
evargast commented
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