1

I have some WordPress plugin projects planned which would benefit greatly from using ReactJS in the WordPress admin.

I'm pretty sure I can get ReactJS working in the admin but the sticking point is how I would go about setting initial state (on initial page load), and saving state when you want to save progress before leaving the page.

There are plenty of examples for using ReactJS on the WordPress front end for themes using the WP REST API to save/set ReactJS state, but what about when working in the WordPress admin? What sort of approach would be best suited here?

@Rarst State in this context is just data in the app. e.g. input values, check boxes, text areas, and so on. The important thing is how the data is saved/retrieved. e.g. it could just be a (JSON) text string.

@cybmeta Good point. Just not seen any solid examples of using the WP REST API from the admin. I guess this will change once it makes it to core.

  • 1
    The question might benefit from more extensive explanation of what "state" is in this context, given that React and its concepts aren't something native to WP. – Rarst Jun 3 '16 at 16:57
  • You can also use REST API in the backend, why not? – cybmeta Jun 3 '16 at 16:59
  • This is the fourth time I am readung the question and except for understanding that you want to work with reactJS, I don't get what is it that you are actually asking. What is exactly that you are having a difficulty with, what concept, or API? – Mark Kaplun Jun 4 '16 at 9:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.