You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "vogievetsky (via GitHub)" <gi...@apache.org> on 2023/06/09 01:23:12 UTC
[GitHub] [druid] vogievetsky commented on a diff in pull request #14380: Upgrades the React dependency to v18
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: 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