Closed differui closed 7 years ago
// index.js const virtual_dom = t7` <h1>test</h1> `; ReactDOM.render(virtual_dom, document.querySelector('#app');
ReactDOM deny to render no-react-element and rise exception:
Uncaught Error: ReactDOM.render(): Invalid component element.
According to implementation in React.isvalidelement.Do little trick:
React.isvalidelement
// index.js const virtual_dom = t7` <h1>test</h1> `; virtual_dom.$$typeof = Symbol.for('react.element'); ReactDOM.render(virtual_dom, document.querySelector('#app');
Rise another exception:
Uncaught Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in.
I should read docs first next time. 😂
ReactDOM deny to render no-react-element and rise exception:
According to implementation in
React.isvalidelement
.Do little trick:Rise another exception: