Something like:
const ProblemChild = ({ children }) => {
return React.Children.map(children, child => {
return React.Children.map(child.props.children, innerChild => {
return innerChild;
});
}).filter(React.isValidElement)
};
const App = () => {
return (
<ProblemChild>
<div>
<div>
1
</div>
<div>
2
</div>
</div>
</ProblemChild>
)
};
returns
in React, but nothing in preact/compat.
It looks like the nested React.Children.map causes React.isValidElement to return false for the divs
reproduce with this repo: https://github.com/skvale/preact-react.children.map-issue
Something like:
returns
in React, but nothing in preact/compat.
It looks like the nested React.Children.map causes
React.isValidElementto return false for thedivsreproduce with this repo: https://github.com/skvale/preact-react.children.map-issue