Uncaught TypeError: Cannot read property 'getDOMNode' of undefined
Hi there Mr. Fang,
I have run into an issue and I suspect that it's pretty unique but it's causing me some problems. I'm getting the following error message:
Uncaught TypeError: Cannot read property 'getDOMNode' of undefined
And this occurs here:
_adjustHeaderWidth: {
value: function _adjustHeaderWidth() {
this.refs.table.getDOMNode().childNodes[0].childNodes[0].style.width = this.refs.table.getDOMNode().childNodes[1].childNodes[0].offsetWidth - 1 + "px";
}
},
It seems to occur when I draw the Table on the page and then remove it. In my application they have something similar to tabs. On the third tab it shows this table. When they click off of the tab the table stops being rendered. After that if they resize their window the console gets filled with that error message.
I'm not quite sure how to handle this on your end. I'd maybe look to see how other react components are unmounting or something. Do you need me to write up a quick and dirty example?
Hi @urahonky, maybe give me a quick sample, I can debug it. :))
Sorry Mr. Fang... Work has been crazy today. Hopefully I get a break tomorrow for me to write up a quick example.
that's ok, take your time :)
BootstrapTable.js:294 Uncaught TypeError: Cannot read property 'getDOMNode' of undefined Can this help? version 0.9.7
Hi @chuchengcao
I probably know the problem is just the this.ref.table does not exist, and add a if condition maybe a quickly solve way. But I want to know what condition and why caused it :)
Anyway, so can you tried out this issue also?
Hi, @AllenFang , thank you for reply. I think I found the method to repeat the problem.
- Transition to a page which render the React-bootstrap-table;
- Transition to another page which does not contain the React-bootstrap-table;
- Change the view port height (alter the brower height for example)
- Got the error
- Even though we transition to the page which render the React-bootstrap-table again, the problem still exist; Source code is a bit too many, do you need the source code?
OK, I got it. I'll check it out, thanks very much :)
I got the same problem when I resize the browser window.

Hi @chuchengcao, @LeeChSien, I follow your instruction but I can't get this problem. how you change the page or can give some certainly example ?
I've fixed this problem by avoiding this error happened for a temporary solution, if any bug appear, plz report. However, update to v0.9.11 and check it out :)
No such errors anymore :)