Skip to content

feat: add useStateWithPrev#7961

Merged
SevereCloud merged 1 commit intomasterfrom
SevereCloud/fix/usePrevious/use-state
Nov 20, 2024
Merged

feat: add useStateWithPrev#7961
SevereCloud merged 1 commit intomasterfrom
SevereCloud/fix/usePrevious/use-state

Conversation

@SevereCloud
Copy link
Copy Markdown
Contributor

@SevereCloud SevereCloud commented Nov 19, 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.

Изменения

  • Добавляем хук useStateWithPrev
  • Депрекейтим usePrevious

Release notes

@SevereCloud SevereCloud requested a review from a team as a code owner November 19, 2024 14:55
@SevereCloud SevereCloud self-assigned this Nov 19, 2024
@SevereCloud SevereCloud force-pushed the SevereCloud/fix/usePrevious/use-state branch from 74fef70 to aa81cf4 Compare November 19, 2024 14:58
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 19, 2024

size-limit report 📦

Path Size
JS 383.55 KB (+0.11% 🔺)
JS (gzip) 116.25 KB (+0.11% 🔺)
JS (brotli) 95.67 KB (-0.04% 🔽)
JS import Div (tree shaking) 1.46 KB (0%)
CSS 334.66 KB (0%)
CSS (gzip) 42.33 KB (0%)
CSS (brotli) 33.39 KB (0%)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 19, 2024

e2e tests

Playwright Report

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Nov 19, 2024

👀 Docs deployed

Commit bccaf56

@SevereCloud SevereCloud force-pushed the SevereCloud/fix/usePrevious/use-state branch from aa81cf4 to 8408de5 Compare November 19, 2024 16:18
@SevereCloud SevereCloud force-pushed the SevereCloud/fix/usePrevious/use-state branch from 8408de5 to bccaf56 Compare November 20, 2024 08:21
@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.

@codecov
Copy link
Copy Markdown

codecov bot commented Nov 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.27%. Comparing base (4ac222e) to head (bccaf56).
Report is 2 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #7961   +/-   ##
=======================================
  Coverage   95.26%   95.27%           
=======================================
  Files         378      379    +1     
  Lines       11218    11239   +21     
  Branches     3744     3746    +2     
=======================================
+ Hits        10687    10708   +21     
  Misses        531      531           
Flag Coverage Δ
unittests 95.27% <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.


🚨 Try these New Features:

@SevereCloud SevereCloud merged commit e1077e5 into master Nov 20, 2024
@SevereCloud SevereCloud deleted the SevereCloud/fix/usePrevious/use-state branch November 20, 2024 09:45
@SevereCloud SevereCloud added this to the v7.0.0-beta.2 milestone Nov 20, 2024
@vkcom-publisher
Copy link
Copy Markdown
Contributor

v7.0.0-beta.2 🎉

@inomdzhon inomdzhon modified the milestones: v7.0.0-beta.2, v7.0.0 Dec 2, 2024
@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.

5 participants