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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setEuiDevProviderWarning to accept an optional callback function #7807

Closed
tsullivan opened this issue Jun 1, 2024 · 0 comments · Fixed by #7820
Closed

setEuiDevProviderWarning to accept an optional callback function #7807

tsullivan opened this issue Jun 1, 2024 · 0 comments · Fixed by #7820
Assignees

Comments

@tsullivan
Copy link
Member

Is your feature request related to a problem? Please describe.

There's in-progress work to warn Kibana developers in a "soft" way when they have a React rendering tree that is missing EuiProvider: elastic/kibana#184608

My goal for the error behavior is to display a warning toast, and invoke a warning in the console. EUI offers a method called setEuiDevProviderWarning, and it can do the console warning, but it would need some enhancement in order to show the toast. (Of course, this behavior would be limited to dev mode.)

Describe the solution you'd like
A clear and concise description of what you want to happen.

I propose that setEuiDevProviderWarning accept an optional callback function. That would allow users of the method to add custom behavior, such as showing a warning toast.

Describe alternatives you've considered

  • Simply rely on console.warn, this is not noticeable enough.
  • Have EUI throw an error when EuiProvider context is missing. This is too disruptive.

Desired timeline
No rush

Additional context
I would like to deliver the PR to add this enhancement to EUI.

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

Successfully merging a pull request may close this issue.

1 participant