Closed nyenye closed 6 years ago
This is expected behavior. This.element returns the DOM node mounted in the page. Since there is only a string representation during server rendering, this.element is always null in that context.
I feared this would be the case. In that case, what could I do to keep the bankai server running? It halts when calling a function from this.element, as it is undefined.
You can test and guard for it by testing for this.element or use something like typeof window !== 'undefined'
Thanks. Will close then!
NP good luck! Feel free to ask questions in IRC as well. Server rendering with stateful components is a tricky problem.
Oh good to know there's an IRC channel. Other sites like stackoverflow are not very useful when using lesser known frameworks and I opted to open an issue. Thanks again!
I've made a nanocomponent, but this.element is undefined while server rendering, and it makes bankai stop when I try to do anything with it, in my case calling getElementsByClassName().
As you can see int the screeshot, it works fine on the browser. Any ideas? Am I doing something wrong, or could this be an issue?
(I'm using an example from Bootstrap as template)
test-choojs.zip