You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "jgoz (via GitHub)" <gi...@apache.org> on 2023/06/06 23:01:02 UTC
[GitHub] [druid] jgoz commented on a diff in pull request #14380: React 18
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org