-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(plasma-core, plasma-hope): Add promise resolve for forceUpdate method in Popup
and Tooltip
components
#554
Conversation
…p` and `Tooltip` components
9e76cb4
to
809ce86
Compare
Theme Builder app deployed! http://plasma.sberdevices.ru/pr/plasma-theme-builder-pr-554/ |
Popup
and Tooltip
componentsPopup
and Tooltip
components
Documentation preview deployed! website: http://plasma.sberdevices.ru/pr/pr-554/ |
Component performance testing Result: 🟢 Success Check out report in job artifacts! |
* Данный хак, нужен для того, чтобы это поведение избежать и перенаправить | ||
* вызов метода в очередь микрозадач. | ||
*/ | ||
Promise.resolve().then(forceUpdate); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
не должны были. Этот метод всё-равно выполняется, но теперь в правильном порядке с точки зрения событийного цикла реакта
/* | ||
* INFO: Метод forceUpdate содержит в себе flushSync и приводит | ||
* к повторному рендеру компонента, который уже находится в процессе рендера. | ||
* Данный хак, нужен для того, чтобы это поведение избежать и перенаправить |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
весело конечно
Исправлено поведение компонентов
Tooltip
иPopup
, при использовании которых при изменении стейта возникала ошибка: Warning: flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.Это связано с тем, что в новой версии библиотеки
popper
методforceUpdate
содержит в себеflushSync
и приводит к повторному рендеру компонента, который уже находится в процессе рендера.🐤 Download canary assets:
color_sberHealth_ios-swift--canary.554.5210791882.swift
color_sberHealth_kotlin--canary.554.5210791882.kt
color_sberHealth_react-native--canary.554.5210791882.ts
color_sbermarket_business_ios-swift--canary.554.5210791882.swift
color_sbermarket_business_kotlin--canary.554.5210791882.kt
color_sbermarket_business_react-native--canary.554.5210791882.ts
color_sbermarket_ios-swift--canary.554.5210791882.swift
color_sbermarket_kotlin--canary.554.5210791882.kt
color_sbermarket_metro_ios-swift--canary.554.5210791882.swift
color_sbermarket_metro_kotlin--canary.554.5210791882.kt
color_sbermarket_metro_react-native--canary.554.5210791882.ts
color_sbermarket_react-native--canary.554.5210791882.ts
color_sbermarket_selgros_ios-swift--canary.554.5210791882.swift
color_sbermarket_selgros_kotlin--canary.554.5210791882.kt
color_sbermarket_selgros_react-native--canary.554.5210791882.ts
color_sbermarket_wlbusiness_ios-swift--canary.554.5210791882.swift
color_sbermarket_wlbusiness_kotlin--canary.554.5210791882.kt
color_sbermarket_wlbusiness_react-native--canary.554.5210791882.ts
color_sberonline_ios-swift--canary.554.5210791882.swift
color_sberonline_kotlin--canary.554.5210791882.kt
color_sberonline_react-native--canary.554.5210791882.ts
color_sberprime_ios-swift--canary.554.5210791882.swift
color_sberprime_kotlin--canary.554.5210791882.kt
color_sberprime_react-native--canary.554.5210791882.ts
shadow_sbermarket_react-native--canary.554.5210791882.ts
typo_mage_ios-swift--canary.554.5210791882.swift
typo_mage_kotlin--canary.554.5210791882.kt
typo_mage_react-native--canary.554.5210791882.ts
typo_plasma_ios-swift--canary.554.5210791882.swift
typo_plasma_kotlin--canary.554.5210791882.kt
typo_plasma_react-native--canary.554.5210791882.ts
typo_ruler_ios-swift--canary.554.5210791882.swift
typo_ruler_kotlin--canary.554.5210791882.kt
typo_ruler_react-native--canary.554.5210791882.ts
typo_sage_ios-swift--canary.554.5210791882.swift
typo_sage_kotlin--canary.554.5210791882.kt
typo_sage_react-native--canary.554.5210791882.ts
typo_sbermarket_ios-swift--canary.554.5210791882.swift
typo_sbermarket_kotlin--canary.554.5210791882.kt
typo_sbermarket_react-native--canary.554.5210791882.ts
typo_soulmate_ios-swift--canary.554.5210791882.swift
typo_soulmate_kotlin--canary.554.5210791882.kt
typo_soulmate_react-native--canary.554.5210791882.ts
📦 Published PR as canary version:
Canary Versions
✨ Test out this PR locally via:
Version
Published prerelease version:
@salutejs/[email protected]
@salutejs/[email protected]
@salutejs/[email protected]
@salutejs/[email protected]
@salutejs/[email protected]
@salutejs/[email protected]
@salutejs/[email protected]
@salutejs/[email protected]
@salutejs/[email protected]
@salutejs/[email protected]
@salutejs/[email protected]
@salutejs/[email protected]
@salutejs/[email protected]
@salutejs/[email protected]
Changelog
🚀 Enhancement
@salutejs/plasma-tokens-utils
🐛 Bug Fix
@salutejs/plasma-core
,@salutejs/plasma-hope
Popup
andTooltip
components #554 ([email protected])@salutejs/plasma-tokens
dev
Authors: 4