You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.
I have a case where I need to iterate over the children of a component and change them based on if their type == a specific type.
So image <TabPanel> which iterates on its children to look for <Tab>
This works so long as <Tab> is directly under <TabPanel>
but if someone takes <Tab> and mutates it using any HOC, the type is no long <Tab> when I iterate over it using:
constchildren=React.Children.map(childComponents,(child: React.ReactElement<Tab>)=>{if(child.type&&child.type===Tab){// After HOC, no longer a tabreturnReact.cloneElement(child,{
disabled,
size,});});
Is there anyway to tell compose to keep the old type? or extend it?
The text was updated successfully, but these errors were encountered:
oreporan
changed the title
casting component type after HOC
component type mutated after HOC
Nov 26, 2018
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I have a case where I need to iterate over the children of a component and change them based on if their type == a specific type.
So image
<TabPanel>
which iterates on its children to look for<Tab>
This works so long as
<Tab>
is directly under<TabPanel>
but if someone takes
<Tab>
and mutates it using any HOC, the type is no long<Tab>
when I iterate over it using:Is there anyway to tell compose to keep the old type? or extend it?
The text was updated successfully, but these errors were encountered: