Closed bestickley closed 1 year ago
React
Primitive components
Vite
Chrome
See below TS error:
<Tabs> should accept null as child as documented here
<Tabs>
null
Conditionally render <TabItem> within <Tab> and see TS error.
<TabItem>
<Tab>
let RequestTabItem: ReactElement | null = null; if (canViewRequests) { RequestTabItem = ( <TabItem title={<RequestsBadge count={length} loading={isFetching} />} onClick={() => navigate("requests")} /> ); } return ( <> <Tabs currentIndex={tab} onChange={handleChange} marginBottom="small"> <TabItem title="Members" onClick={() => navigate("members")} /> {RequestTabItem} </Tabs>
Amplify UI does correctly not log warning message when null. This is just a TS issue.
@bestickley Thanks for reporting this, we'll get it fixed!
This should be fixed in #3270 and go out in the next release!
Fixed by https://github.com/aws-amplify/amplify-ui/pull/3270
Before creating a new issue, please confirm:
On which framework/platform are you having an issue?
React
Which UI component?
Primitive components
How is your app built?
Vite
What browsers are you seeing the problem on?
Chrome
Please describe your bug.
See below TS error:
What's the expected behaviour?
<Tabs>
should acceptnull
as child as documented hereHelp us reproduce the bug!
Conditionally render
<TabItem>
within<Tab>
and see TS error.Code Snippet
Additional information and screenshots
Amplify UI does correctly not log warning message when
null
. This is just a TS issue.