react-component / react-component/tabs
ScrollableInkTabBar supports extraContent but get error with InkTabBar?
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 572
- Forks
- 241
- Avg merge
- 4d 18h
- Merged PRs (30d)
- 4
Description
If I do this:
<Tabs
renderTabBar={() =>
<ScrollableInkTabBar
onTabClick={onTabClick}
extraContent={<Button>hi</Button>}
/>
}
...
I get the button as expected. However, if I do this:
<Tabs
renderTabBar={() =>
<InkTabBar
onTabClick={onTabClick}
extraContent={<Button>hi</Button>}
/>
}
...
I get an exception:
Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.
at createFiberFromTypeAndProps (react-dom.development.js:26629)
at createFiberFromElement (react-dom.development.js:26652)
at createChild (react-dom.development.js:14958)
at reconcileChildrenArray (react-dom.development.js:15232)
at reconcileChildFibers (react-dom.development.js:15598)
at reconcileChildren (react-dom.development.js:18089)
at updateHostComponent (react-dom.development.js:18611)
at beginWork$1 (react-dom.development.js:20193)
at HTMLUnknownElement.callCallback (react-dom.development.js:336)
at Object.invokeGuardedCallbackDev (react-dom.development.js:385)
at invokeGuardedCallback (react-dom.development.js:440)
at beginWork$$1 (react-dom.development.js:25780)
at performUnitOfWork (react-dom.development.js:24695)
at workLoopSync (react-dom.development.js:24671)
at performSyncWorkOnRoot (react-dom.development.js:24270)
at react-dom.development.js:12199
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the InkTabBar and ScrollableInkTabBar entry points and compare how each handles the extraContent prop. Reproduce the exception with the two JSX examples, then add regression coverage where the tab-bar tests are located; done means InkTabBar renders extraContent without the invalid-element error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- react, typescript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100