Closed eugenet8k closed 2 years ago
@eugenet8k
Is there a specific function in the lib that you can point me to that has this issue?
Hello! I came to this issue since I ran into it as well. I was using the getChildByTypeDeep
function.
FWIW, if I remove the filter part of this line from the tests and add a test case like { type: 'div', props: { children: [null, {type: 'div'}] } },
to the children in src/getChildByType/index.deep.test.js
, I get this error as well.
Can you explain why https://github.com/TheSpicyMeatball/react-nanny/blob/main/src/getChildByType/index.deep.test.js#L31 is added to the tests and not something we handle in the src?
I took a stab at correcting this here. Please let me know what you think!
@TheSpicyMeatball not sure if you got notified of this since it's a closed issue, thanks!
In case anyone else stumbles upon this issue, our team has decided to use react-children-utilities instead. It supports our needs, has more stars, has more downloads, is smaller, and supports React 15 - 18.
If React markup has a child under the condition
the result children will be
[element, null]
and that will crash the lib.