vogievetsky commented on code in PR #14380:
URL: https://github.com/apache/druid/pull/14380#discussion_r1223722343


##########
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:
   That is very insightful! Could you please add that comment (exactly as 
written) to the code itself?
   
   Maybe also include that the warning is: `react-dom.development.js:86 
Warning: ReactDOM.render is no longer supported in React 18. Use createRoot 
instead. Until you switch to the new API, your app will behave as if it's 
running React 17. Learn more: https://reactjs.org/link/switch-to-createroot`



-- 
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]

Reply via email to