Closed LoganDark closed 3 years ago
I'm not sure I follow. Can you provide a simple code example of what you're trying to accomplish?
I'm not sure I follow. Can you provide a simple code example of what you're trying to accomplish?
I managed to do it using getChildren(children, isElement)
, where isElement
is from react-is
, if that helps you understand.
I think the way you did it is likely the best way unless there's a shortcoming with that which I'm missing?
Yeah, I solved my issue
Cool, thanks for the clarification.
Makes sure all children were made by
React.createElement
, i.e. you can safely access their props and component and stuff. I'm making a component that wants to preserve props of its children, but modify a couple (style
andclassName
).