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.
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
console.warn, this is not noticeable enough.Desired timeline
No rush
Additional context
I would like to deliver the PR to add this enhancement to EUI.