So, I have two components, one is always going to be a direct descendant of another. I want to pass props from parent component to the child. There could be more than one child components. There're two ways to achieve it.
React.Children.map(children, (child) =>
React.cloneElement(child, { someProp: 'value' })
)
or using the Context API
<Context.Provider value={{ someProp: 'value' }}>
{this.props.children}
</Context.Provider>
Both will result in the same DOM structure, however, Context API is slightly more code and will result in more React Components.
So which one is more performance oriented and recommended. I couldn't find any discussion related to this comparison, thus asking here.