jgoz commented on code in PR #14380:
URL: https://github.com/apache/druid/pull/14380#discussion_r1220508971
##########
web-console/src/singletons/toaster.ts:
##########
@@ -16,9 +16,16 @@
* limitations under the License.
*/
-import { Position, Toaster } from '@blueprintjs/core';
+import type { ToasterInstance } from '@blueprintjs/core';
+import { OverlayToaster, Position } from '@blueprintjs/core';
-export const AppToaster = Toaster.create({
- className: 'recipe-toaster',
- position: Position.TOP,
-});
+let toaster: ToasterInstance | undefined;
+
+export const AppToaster: { show: ToasterInstance['show'] } = {
+ show: (...args) => {
+ if (!toaster) {
+ toaster = OverlayToaster.create({ className: 'recipe-toaster', position:
Position.TOP });
Review Comment:
Making this lazy-init avoids a deprecation notice for "ReactDOM.render",
both on initial load and in every unit test.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]