JavaScript for WordPress Forums Gutenberg Development React on the frontend

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #132660
    Rodrigo Barriuso

    I’m trying to render this basic code using REact on the frontend

    const { render } = wp.element;
    render(<p>HOLA</p>, document.querySelector("entry-title"));

    and I’m getting this error

     Uncaught Error: Minified React error #200; visit for the full message or use the non-minified dev environment for full errors and additional helpful warnings. 
        at render (react-dom.min.js?ver=16.9.0:227)
        at eval (frontend.js?ae21:9)
        at Object.127 (frontend.blocks.js?ver=1578960271:79)
        at __webpack_require__ (frontend.blocks.js?ver=1578960271:20)
        at eval (frontend.js?d2d5:1)
        at Object.126 (frontend.blocks.js?ver=1578960271:72)
        at __webpack_require__ (frontend.blocks.js?ver=1578960271:20)
        at frontend.blocks.js?ver=1578960271:63
        at frontend.blocks.js?ver=1578960271:66

    I’ve set wp-element as a dependency when enqueuing the frontend.js

    Not sure what I’m doing wrong

    Zac Gordon
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.