Crash: removedChildren count (0) was not what we expected (56)
See original GitHub issueI get the error above which results in a crash.
This error happens when I try to remove the view that contains lot’s of lines rendered like so:
const linesArray = [];
for (let i = 0, lineCnt = Math.ceil(realLineCnt); i <= lineCnt; i += 1) {
// top left pivot
linesArray.push(
<Line
key={i}
x1={i * (props.strokeWidth * 2.83333333)}
y1={-5}
x2={(i * (props.strokeWidth * 2.83333333)) - ((props.width * props.height) / props.width)}
y2={props.height + 5}
stroke={props.strokeColor}
strokeWidth={props.strokeWidth}
/>);
}
which are later rendered like so:
<SvgRender
height={props.height}
width={props.width}
style={styles.svgContainer}
>
{linesArray}
</SvgRender>
I see the error in a react-native red box, but the error originates from this react-native line of code.
I assume that the number 56 is the number of my lines.
Could it be that react-native-svg
makes it hard for react-native to remove it’s children and deallocate their memory?
Please advise!
Issue Analytics
- State:
- Created 7 years ago
- Reactions:13
- Comments:35
Top Results From Across the Web
Crash: removedChildren count (0) was not what we expected ...
I see the error in a react-native red box, but the error originates from this react-native line of code. I assume that the...
Read more >Unanswered 'react-native-svg' Questions - Stack Overflow
... coordinates on a map, but I keep getting this error thrown, followed by: removedChildren count(0) was not what we expected (1) This...
Read more >Protecting Children in Substance-Abusing Families
As is true in most cases of child maltreatment, parents and caregivers who abuse alcohol and/or other drugs do not intend to harm...
Read more >React/Modules/RCTUIManager.m ... - GitLab
RCTLogError(@"RCTLayoutAnimation expects timings to be in ms, not seconds."); ... stringWithFormat:@"removedChildren count (%tu) was not what we expected ...
Read more >DFPS Compensation Assessment and Employee Incentives ...
competitive salary of a specialist position is expected at $55,642 ... Rationale: DFPS focus groups reported that they could not recognize ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I finally figured out this issue. It was caused by rendering multiple svg components with map function without wrapping it. Here is the code that caused an error:
See, the resulting bunch of Lines returned my map() mixed with other Lines in parent component. During re-render my number of ticksY changed and I guess that was the cause of a mess.
The solution was to wrap the bunch of Lines with a parent component, <G> in my case:
This is happening to me specially with the
LinearGradient
component fromreact-native-svg
. Removing it / using other types of graphs removes the error.updated @msand
package.json:
react-native info: