Skip to content

fix(useReducedMotion): use state#8008

Merged
SevereCloud merged 1 commit intomasterfrom
SevereCloud/fix/useReducedMotion/use-state
Nov 28, 2024
Merged

fix(useReducedMotion): use state#8008
SevereCloud merged 1 commit intomasterfrom
SevereCloud/fix/useReducedMotion/use-state

Conversation

@SevereCloud
Copy link
Copy Markdown
Contributor

@SevereCloud SevereCloud commented Nov 28, 2024


  • Unit-тесты
  • e2e-тесты
  • Дизайн-ревью
  • Документация фичи
  • Release notes

Описание

Хук useRef нельзя использовать для чтения или записи во время рендеринга

Do not write or read ref.current during rendering.
...
If you have to read or write something during rendering, use state instead.

When you break these rules, your component might still work, but most of the newer features we’re adding to React will rely on these expectations. Read more about keeping your components pure.

Изменения

  • Используем useState вместо useRef
  • Делаем хук useReducedMotion более дружелюбным к SSR
  • Оптимизируем Spinner вынося use client код отдельно

Release notes

Исправления

  • Spinner: вынос use client кода отдельно

@SevereCloud SevereCloud requested a review from a team as a code owner November 28, 2024 08:41
@github-actions
Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size
JS 385.31 KB (-0.02% 🔽)
JS (gzip) 116.79 KB (-0.03% 🔽)
JS (brotli) 96.14 KB (-0.03% 🔽)
JS import Div (tree shaking) 1.56 KB (0%)
CSS 334.98 KB (0%)
CSS (gzip) 42.41 KB (0%)
CSS (brotli) 33.42 KB (0%)

@codesandbox-ci
Copy link
Copy Markdown

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@SevereCloud SevereCloud self-assigned this Nov 28, 2024
@github-actions
Copy link
Copy Markdown
Contributor

e2e tests

Playwright Report

@codecov
Copy link
Copy Markdown

codecov bot commented Nov 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.46%. Comparing base (cb55d05) to head (f9173e7).
Report is 3 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #8008      +/-   ##
==========================================
- Coverage   95.46%   95.46%   -0.01%     
==========================================
  Files         380      381       +1     
  Lines       11324    11320       -4     
  Branches     3777     3776       -1     
==========================================
- Hits        10811    10807       -4     
  Misses        513      513              
Flag Coverage Δ
unittests 95.46% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@SevereCloud SevereCloud added this to the v7.0.0 milestone Nov 28, 2024
@SevereCloud SevereCloud merged commit a698551 into master Nov 28, 2024
@SevereCloud SevereCloud deleted the SevereCloud/fix/useReducedMotion/use-state branch November 28, 2024 10:05
@vkcom-publisher
Copy link
Copy Markdown
Contributor

v7.0.0 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants