Hello! The other day I was asked to do one portion of a website, that currently doesn’t work, and using whatever I want. I’m not a WordPress developer, so by “whatever I want” I thought about using what I always use; React. The problem is that I don’t know if React is compatible with WP, or if they’ll be able to at least send my code over there. If it isn’t, what should I learn instead? (Vanilla JS wouldn’t work since they want it to be somewhat fast and they need to render specific data depending on user input, but I might settle for it if there’s no other solution)
[ad_2]
Couple of suggestion. First, Gutenberg blocks are built with React and you can actually build blocks in React for WordPress as well. Haven’t done it myself, but I know for a fact you can.
Secondly, I did some contract work with a company who essentially had a plugin they built that basically just pops in the output React code into a div with the ID of “root” on the desired WordPress page. It was pretty janky, but it could be done much nicer. Essentially, if you link the bundled javascript and enqueued it on your WordPress site, it should just do what it’s intended to do, which is Look for a div with the ID of “root” and then just inject itself. Not very SEO friendly, but it works.
>The problem is that I don’t know if React is compatible with WP, or if they’ll be able to at least send my code over there.
React is just JavaScript when it is compiled so it or any other JS frontend library will work with WP.
​
>Vanilla JS wouldn’t work since they want it to be somewhat fast
Yeah but vanilla JS will always be faster than React or any other JS frontend library.
>Vanilla JS wouldn’t work since they want it to be somewhat fast
Lol, what?
>they need to render specific data depending on user input
Lots of ways to accomplish this. Without knowing more about the specifics, it is difficult to provide pros and cons of particular methods.
>I’m seriously considering lying on my resume
>https://www.reddit.com/r/recruitinghell/comments/zry417/im_seriously_considering_lying_on_my_resume/
Sounds like you may have gotten yourself in over your head.