react-component / react-component/tabs

TypeError: Cannot read property 'offsetWidth' of null

Open
#329 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
572
Forks
241
Avg merge
4d 18h
Merged PRs (30d)
4

Description

Using antd tabs in one of my projects and getting this error in rc-tabs

I did see issue #300 so I updated antd and rc-tabs, but the error is still happening.

Unhandled Runtime Error
TypeError: Cannot read property 'offsetWidth' of null

Call Stack
eval
node_modules/rc-tabs/es/TabNavList/index.js (313:0)
Array.forEach
<anonymous>
eval
node_modules/rc-tabs/es/TabNavList/index.js (309:0)
eval
node_modules/rc-tabs/es/hooks/useRaf.js (40:0)
Array.forEach
<anonymous>
eval
node_modules/rc-tabs/es/hooks/useRaf.js (39:0)
eval
node_modules/rc-tabs/es/hooks/useRaf.js (16:0)

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with rc-tabs/es/TabNavList/index.js around lines 309-313 and hooks/useRaf.js around lines 16, 39-40, then reproduce using an antd tabs setup. Done means the reported offsetWidth null error no longer occurs in the reported scenario; the issue provides no test or reproduction repository to run.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.