Timeline for What is the standard way to use the version of React that ships with Gutenberg on the front end?
Current License: CC BY-SA 4.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Feb 26, 2023 at 13:50 | comment | added | Tom J Nowell♦ |
you also shouldn't interpret anything I said as not using React on the frontend, there's nothing wrong with import ... from 'react'; in a bundle intended for the frontend
|
|
Feb 26, 2023 at 13:48 | comment | added | Tom J Nowell♦ | i agree, since that time it's pretty firmly stuck to React, but the block editor is showing a representation of the frontend, not the literal same thing. E.g. a hyperlink in the block editor isn't a real hyperlink, and a slider wouldn't make sense as it would auto-play to the next slide as you're trying to type into it. That's not to say it isn't possible to use WP packages on the frontend, but the idea that your edit/save/frontend components should all be the same code sounds ideologically and architecturally appealing at first, but they become a nightmarish mess quickly | |
Feb 26, 2023 at 13:33 | comment | added | lookyhooky | FYI I am enquiring with the Gutenberg team on this question too. I will keep this question/answer up to date as I learn more. | |
Feb 26, 2023 at 13:31 | comment | added | lookyhooky | I feel confident that Gutenberg isn't about to pivot away from React. So I'm going to try this out and see how far I can take it. It seems like a better solution than using JQuery or vanilla JavaScript to recreate interactively of a Gutenberg block on the frontend. | |
Feb 26, 2023 at 11:13 | comment | added | Tom J Nowell♦ | note that WP Element is just a wrapper, it was written at a time when the core teams weren't 100% sure they would stick with React in the future and wanted to insulate themselves from compatibility breaks or library changes. You'll see early talk about the block editor sometimes justifies using WP Element to build block UI's with Vue JS. For frontend use this may not be optimal | |
Feb 25, 2023 at 21:58 | history | answered | lookyhooky | CC BY-SA 4.0 |