-
Hey folks, we currently display some tabs, as follow: function RatingTabs(props: { rating: Rating }) {
return (
<div className="w-full bg-black rounded-sm border-2 border-black-lighter">
<Tab.Group defaultIndex={getDefaultIndex(props.rating)}>
<Tab.List className="flex bg-black-pure">
<RiskyRatingTab />
<GoodRatingTab />
<GreatRatingTab />
</Tab.List>
<Tab.Panels className="mt-2">
<RiskyRatingPanel rating={props.rating} />
<GoodRatingPanel rating={props.rating} />
<GreatRatingPanel rating={props.rating} />
</Tab.Panels>
</Tab.Group>
</div>
);
} Which as of today, we had to do some workaround the active tab, function App() {
const query = useQuery('....')
return (
<div>
{query.isLoading ? (
<RatingTabs key="loading" rating={query.data?.rating} />
) : (
<RatingTabs key="active" rating={query.data?.rating} />
)}
<div>
)
} Notice that we render twice the component with different Any idea how we could be solved it differently? |
Beta Was this translation helpful? Give feedback.
Answered by
yordis
Oct 31, 2021
Replies: 1 comment
-
Duplicate of #742 |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
yordis
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Duplicate of #742