Skip to content

Conversation

zombieJ
Copy link
Member

@zombieJ zombieJ commented Sep 15, 2021

ref ant-design/ant-design#31532

因为无法知道客户端的状态,所以必须多一次渲染来让 Cell 识别 sticky。如果不管 IE 就好了,sad~~

@vercel
Copy link

vercel bot commented Sep 15, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/react-component/table/216P4wSyFEPhNG5dK4iwpTMYmszo
✅ Preview: https://table-git-fix-ie-react-component.vercel.app

@codecov
Copy link

codecov bot commented Sep 15, 2021

Codecov Report

Merging #668 (adb8683) into master (730d4df) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head adb8683 differs from pull request most recent head 695b426. Consider uploading reports for the commit 695b426 to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##           master     #668   +/-   ##
=======================================
  Coverage   99.65%   99.66%           
=======================================
  Files          28       29    +1     
  Lines         876      886   +10     
  Branches      260      268    +8     
=======================================
+ Hits          873      883   +10     
  Misses          3        3           
Impacted Files Coverage Δ
src/context/TableContext.tsx 100.00% <ø> (ø)
src/Cell/index.tsx 98.59% <100.00%> (+0.15%) ⬆️
src/Table.tsx 100.00% <100.00%> (ø)
src/context/StickyContext.tsx 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d63bc29...695b426. Read the comment docs.

@tychenjiajun
Copy link

This PR introduce a warning if I assign a stateful functional component to render. See https://codesandbox.io/s/admiring-margulis-siwy4?file=/App.tsx and change rc-table version to both 7.18.0 and 7.17.2 to see the differences.

Warning: React has detected a change in the order of Hooks called by Cell. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://reactjs.org/link/rules-of-hooks

   Previous render            Next render
   ------------------------------------------------------
1. useContext                 useContext
2. undefined                  useState
   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I suggest adding some description that not to assign stateful functional component to the render props.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants