ant-design / cssinjs

https://ant-design.github.io/cssinjs
MIT License
236 stars 59 forks source link

refactor: useInsertionEffect if in React 18 #121

Closed zombieJ closed 1 year ago

zombieJ commented 1 year ago

Side effect should not insert in render function. Which will be removed by prev useEffect: https://codesandbox.io/s/proud-mountain-g7qy82?file=/src/App.js

github-actions[bot] commented 1 year ago

😭 Deploy PR Preview cc4c6d6af81458c6fda7e16d3c6c7c9eb533674c failed. Build logs

🤖 By surge-preview

codecov-commenter commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.05 :tada:

Comparison is base (576b279) 96.14% compared to head (87b5b2e) 96.19%.

:exclamation: Current head 87b5b2e differs from pull request most recent head cc4c6d6. Consider uploading reports for the commit cc4c6d6 to get more accurate results

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #121 +/- ## ========================================== + Coverage 96.14% 96.19% +0.05% ========================================== Files 22 23 +1 Lines 1737 1763 +26 Branches 291 294 +3 ========================================== + Hits 1670 1696 +26 Misses 67 67 ``` | [Impacted Files](https://app.codecov.io/gh/ant-design/cssinjs/pull/121?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ant-design) | Coverage Δ | | |---|---|---| | [src/hooks/useGlobalCache.tsx](https://app.codecov.io/gh/ant-design/cssinjs/pull/121?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ant-design#diff-c3JjL2hvb2tzL3VzZUdsb2JhbENhY2hlLnRzeA==) | `96.15% <100.00%> (+0.43%)` | :arrow_up: | | [src/hooks/useInsertionEffect.tsx](https://app.codecov.io/gh/ant-design/cssinjs/pull/121?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ant-design#diff-c3JjL2hvb2tzL3VzZUluc2VydGlvbkVmZmVjdC50c3g=) | `100.00% <100.00%> (ø)` | | | [src/hooks/useStyleRegister.tsx](https://app.codecov.io/gh/ant-design/cssinjs/pull/121?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=ant-design#diff-c3JjL2hvb2tzL3VzZVN0eWxlUmVnaXN0ZXIudHN4) | `99.60% <100.00%> (+<0.01%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.