Cannot read property 'removeChild' of null
See original GitHub issueI used onMouseDown to delete items data, and I reported this error, unable to locate what the problem was.
<div
className='icon-close'
onMouseDown={this.onDelete.bind(this, value)}>
<Icon
type="close-circle"
className='icon-close' />
</div>
onDelete(value: string) {
console.log(value, 'value')
let { items } = this.state;
items = items!.filter((item: string) => item !== value);
this.setState({ items }, () => {
this.props.onDelete && this.props.onDelete(items);
})
}
Deleting will result in an error and a request will be sent. I don't know where the request originated and whether it can be blocked
I need help Thank you
Issue Analytics
- State:
- Created 4 years ago
- Reactions:23
- Comments:10
Top Results From Across the Web
I receive a 'Uncaught TypeError: Cannot read property ...
I have the following vanillaJS and receive the Cannot read property 'removeChild' of null error. The error occurs in the console when I...
Read more >Cannot read property 'removeChild' of null · Issue #6037 ...
The element whose parentNode no longer exists is an IFRAME and I assume it has been added to the DIV to help measure...
Read more >Uncaught Type: Cannot Read Property RemoveChild of Null
I have created a form that is working beautifully, but serving up an error in the console each time the user backspaces their...
Read more >T139822 "Cannot read property 'removeChild' of null" when ...
"Cannot read property 'removeChild' of null" when pressing "Journal" in the Cite window. Closed, ResolvedPublic1 Estimated Story Points.
Read more >Cannot read property 'removeChild' of null - Google Groups
The next time you encounter this problem, right-click on the page -> Inspect element -> Console tab: here you can trace which plugin...
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 just had these same issues. It was caused by my SortableContainer and SortableElement being assigned inside of the render function. Meaning each time I set the state it would re-render and create a new instance of SortableContainer and SortableElement. That would divorce the old SortableElement from the DOM and cause the issues.
So the solution for me was to assign SortableContainer and SortableElement to variables outside of render() and reference those on render. Also, @rectangletangle is correct, updateBeforeSortStart should be used to set state rather that onSortStart.
I also have this problem which is very annoying: