Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve error messaging when data is undefined #6

Open
evargast opened this issue Oct 27, 2023 · 2 comments
Open

Improve error messaging when data is undefined #6

evargast opened this issue Oct 27, 2023 · 2 comments

Comments

@evargast
Copy link
Contributor

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鈥疉M

馃 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
Copy link

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
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants